<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>upy.hostHelper</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="upy-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="upy-module.html">Package&nbsp;upy</a> ::
        Module&nbsp;hostHelper
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="upy.hostHelper-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="upy.hostHelper-module.html">Module upy.hostHelper</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">   1</tt>  <tt class="py-line"><tt class="py-comment"># -*- coding: utf-8 -*-</tt> </tt>
<a name="L2"></a><tt class="py-lineno">   2</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-docstring">"""</tt> </tt>
<a name="L3"></a><tt class="py-lineno">   3</tt>  <tt class="py-line"><tt class="py-docstring">Created on Sun Dec  5 23:30:44 2010</tt> </tt>
<a name="L4"></a><tt class="py-lineno">   4</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L5"></a><tt class="py-lineno">   5</tt>  <tt class="py-line"><tt class="py-docstring">@author: Ludovic Autin - ludovic.autin@gmail.com</tt> </tt>
<a name="L6"></a><tt class="py-lineno">   6</tt>  <tt class="py-line"><tt class="py-docstring">matrix and transformation came from </tt> </tt>
<a name="L7"></a><tt class="py-lineno">   7</tt>  <tt class="py-line"><tt class="py-docstring">http://www.lfd.uci.edu/~gohlke/code/transformations.py.html</tt> </tt>
<a name="L8"></a><tt class="py-lineno">   8</tt>  <tt class="py-line"><tt class="py-docstring">"""</tt> </tt>
<a name="L9"></a><tt class="py-lineno">   9</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">os</tt> </tt>
<a name="L10"></a><tt class="py-lineno">  10</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">math</tt> </tt>
<a name="L11"></a><tt class="py-lineno">  11</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">random</tt> </tt>
<a name="L12"></a><tt class="py-lineno">  12</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt class="py-name">math</tt> <tt class="py-keyword">import</tt> <tt class="py-op">*</tt> </tt>
<a name="L13"></a><tt class="py-lineno">  13</tt>  <tt class="py-line"><tt id="link-0" class="py-name" targets="Variable upy.hostHelper.usenumpy=upy.hostHelper-module.html#usenumpy"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-0', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L14"></a><tt class="py-lineno">  14</tt>  <tt class="py-line"><tt class="py-keyword">try</tt> <tt class="py-op">:</tt> </tt>
<a name="L15"></a><tt class="py-lineno">  15</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">numpy</tt> </tt>
<a name="L16"></a><tt class="py-lineno">  16</tt>  <tt class="py-line">    <tt class="py-keyword">import</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">oldnumeric</tt> <tt class="py-keyword">as</tt> <tt class="py-name">Numeric</tt> </tt>
<a name="L17"></a><tt class="py-lineno">  17</tt>  <tt class="py-line">    <tt id="link-1" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-1', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L18"></a><tt class="py-lineno">  18</tt>  <tt class="py-line"><tt class="py-keyword">except</tt> <tt class="py-op">:</tt> </tt>
<a name="L19"></a><tt class="py-lineno">  19</tt>  <tt class="py-line">    <tt id="link-2" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-2', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L20"></a><tt class="py-lineno">  20</tt>  <tt class="py-line"> </tt>
<a name="L21"></a><tt class="py-lineno">  21</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-3" class="py-name" targets="Package upy=upy-module.html"><a title="upy" class="py-name" href="#" onclick="return doclink('link-3', 'upy', 'link-3');">upy</a></tt> <tt class="py-keyword">import</tt> <tt id="link-4" class="py-name" targets="Module upy.colors=upy.colors-module.html"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-4', 'colors', 'link-4');">colors</a></tt> </tt>
<a name="L22"></a><tt class="py-lineno">  22</tt>  <tt class="py-line"> </tt>
<a name="Helper"></a><div id="Helper-def"><a name="L23"></a><tt class="py-lineno">  23</tt> <a class="py-toggle" href="#" id="Helper-toggle" onclick="return toggle('Helper');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html">Helper</a><tt class="py-op">:</tt> </tt>
</div><div id="Helper-collapsed" style="display:none;" pad="++++" indent="++++"></div><div id="Helper-expanded"><a name="L24"></a><tt class="py-lineno">  24</tt>  <tt class="py-line">    <tt class="py-docstring">"""</tt> </tt>
<a name="L25"></a><tt class="py-lineno">  25</tt>  <tt class="py-line"><tt class="py-docstring">    The Helper abstract Object</tt> </tt>
<a name="L26"></a><tt class="py-lineno">  26</tt>  <tt class="py-line"><tt class="py-docstring">    ============================</tt> </tt>
<a name="L27"></a><tt class="py-lineno">  27</tt>  <tt class="py-line"><tt class="py-docstring">    This is the main class from which all helper derived. The Helper </tt> </tt>
<a name="L28"></a><tt class="py-lineno">  28</tt>  <tt class="py-line"><tt class="py-docstring">    give access to the basic function need for create and edit object </tt> </tt>
<a name="L29"></a><tt class="py-lineno">  29</tt>  <tt class="py-line"><tt class="py-docstring">    in the host.</tt> </tt>
<a name="L30"></a><tt class="py-lineno">  30</tt>  <tt class="py-line"><tt class="py-docstring">    Most of the function define at this loevel are overwrite by the class child.</tt> </tt>
<a name="L31"></a><tt class="py-lineno">  31</tt>  <tt class="py-line"><tt class="py-docstring">    """</tt> </tt>
<a name="L32"></a><tt class="py-lineno">  32</tt>  <tt class="py-line">    <tt id="link-5" class="py-name" targets="Variable upy.hostHelper.Helper._usenumpy=upy.hostHelper.Helper-class.html#_usenumpy"><a title="upy.hostHelper.Helper._usenumpy" class="py-name" href="#" onclick="return doclink('link-5', '_usenumpy', 'link-5');">_usenumpy</a></tt> <tt class="py-op">=</tt> <tt id="link-6" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-6', 'usenumpy', 'link-0');">usenumpy</a></tt> </tt>
<a name="L33"></a><tt class="py-lineno">  33</tt>  <tt class="py-line">    <tt id="link-7" class="py-name" targets="Variable upy.hostHelper.Helper._MGLTools=upy.hostHelper.Helper-class.html#_MGLTools"><a title="upy.hostHelper.Helper._MGLTools" class="py-name" href="#" onclick="return doclink('link-7', '_MGLTools', 'link-7');">_MGLTools</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L34"></a><tt class="py-lineno">  34</tt>  <tt class="py-line">    <tt id="link-8" class="py-name" targets="Variable upy.hostHelper.Helper.BONES=upy.hostHelper.Helper-class.html#BONES"><a title="upy.hostHelper.Helper.BONES" class="py-name" href="#" onclick="return doclink('link-8', 'BONES', 'link-8');">BONES</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L35"></a><tt class="py-lineno">  35</tt>  <tt class="py-line">    <tt id="link-9" class="py-name" targets="Variable upy.hostHelper.Helper.IK=upy.hostHelper.Helper-class.html#IK"><a title="upy.hostHelper.Helper.IK" class="py-name" href="#" onclick="return doclink('link-9', 'IK', 'link-9');">IK</a></tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L36"></a><tt class="py-lineno">  36</tt>  <tt class="py-line">     </tt>
<a name="Helper.__init__"></a><div id="Helper.__init__-def"><a name="L37"></a><tt class="py-lineno">  37</tt> <a class="py-toggle" href="#" id="Helper.__init__-toggle" onclick="return toggle('Helper.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.__init__-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.__init__-expanded"><a name="L38"></a><tt class="py-lineno">  38</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt> <tt class="py-op">:</tt> </tt>
<a name="L39"></a><tt class="py-lineno">  39</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">DejaVu</tt> </tt>
<a name="L40"></a><tt class="py-lineno">  40</tt>  <tt class="py-line">            <tt id="link-10" class="py-name"><a title="upy.hostHelper.Helper._MGLTools" class="py-name" href="#" onclick="return doclink('link-10', '_MGLTools', 'link-7');">_MGLTools</a></tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L41"></a><tt class="py-lineno">  41</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt> <tt class="py-op">:</tt> </tt>
<a name="L42"></a><tt class="py-lineno">  42</tt>  <tt class="py-line">            <tt id="link-11" class="py-name"><a title="upy.hostHelper.Helper._MGLTools" class="py-name" href="#" onclick="return doclink('link-11', '_MGLTools', 'link-7');">_MGLTools</a></tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L43"></a><tt class="py-lineno">  43</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name" targets="Method upy.hostHelper.Helper.createColorsMat()=upy.hostHelper.Helper-class.html#createColorsMat"><a title="upy.hostHelper.Helper.createColorsMat" class="py-name" href="#" onclick="return doclink('link-12', 'createColorsMat', 'link-12');">createColorsMat</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L44"></a><tt class="py-lineno">  44</tt>  <tt class="py-line"> </tt>
<a name="Helper.fit_view3D"></a><div id="Helper.fit_view3D-def"><a name="L45"></a><tt class="py-lineno">  45</tt> <a class="py-toggle" href="#" id="Helper.fit_view3D-toggle" onclick="return toggle('Helper.fit_view3D');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#fit_view3D">fit_view3D</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.fit_view3D-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.fit_view3D-expanded"><a name="L46"></a><tt class="py-lineno">  46</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L47"></a><tt class="py-lineno">  47</tt>  <tt class="py-line"> </tt>
<a name="Helper.vector_norm"></a><div id="Helper.vector_norm-def"><a name="L48"></a><tt class="py-lineno">  48</tt> <a class="py-toggle" href="#" id="Helper.vector_norm-toggle" onclick="return toggle('Helper.vector_norm');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#vector_norm">vector_norm</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">data</tt><tt class="py-op">,</tt> <tt class="py-param">axis</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">out</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.vector_norm-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.vector_norm-expanded"><a name="L49"></a><tt class="py-lineno">  49</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return length, i.e. eucledian norm, of ndarray along axis.</tt> </tt>
<a name="L50"></a><tt class="py-lineno">  50</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L51"></a><tt class="py-lineno">  51</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v = numpy.random.random(3)</tt> </tt>
<a name="L52"></a><tt class="py-lineno">  52</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; n = vector_norm(v)</tt> </tt>
<a name="L53"></a><tt class="py-lineno">  53</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(n, numpy.linalg.norm(v))</tt> </tt>
<a name="L54"></a><tt class="py-lineno">  54</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L55"></a><tt class="py-lineno">  55</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v = numpy.random.rand(6, 5, 3)</tt> </tt>
<a name="L56"></a><tt class="py-lineno">  56</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; n = vector_norm(v, axis=-1)</tt> </tt>
<a name="L57"></a><tt class="py-lineno">  57</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=2)))</tt> </tt>
<a name="L58"></a><tt class="py-lineno">  58</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L59"></a><tt class="py-lineno">  59</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; n = vector_norm(v, axis=1)</tt> </tt>
<a name="L60"></a><tt class="py-lineno">  60</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=1)))</tt> </tt>
<a name="L61"></a><tt class="py-lineno">  61</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L62"></a><tt class="py-lineno">  62</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v = numpy.random.rand(5, 4, 3)</tt> </tt>
<a name="L63"></a><tt class="py-lineno">  63</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; n = numpy.empty((5, 3), dtype=numpy.float64)</tt> </tt>
<a name="L64"></a><tt class="py-lineno">  64</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; vector_norm(v, axis=1, out=n)</tt> </tt>
<a name="L65"></a><tt class="py-lineno">  65</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(n, numpy.sqrt(numpy.sum(v*v, axis=1)))</tt> </tt>
<a name="L66"></a><tt class="py-lineno">  66</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L67"></a><tt class="py-lineno">  67</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; vector_norm([])</tt> </tt>
<a name="L68"></a><tt class="py-lineno">  68</tt>  <tt class="py-line"><tt class="py-docstring">        0.0</tt> </tt>
<a name="L69"></a><tt class="py-lineno">  69</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; vector_norm([1.0])</tt> </tt>
<a name="L70"></a><tt class="py-lineno">  70</tt>  <tt class="py-line"><tt class="py-docstring">        1.0</tt> </tt>
<a name="L71"></a><tt class="py-lineno">  71</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L72"></a><tt class="py-lineno">  72</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L73"></a><tt class="py-lineno">  73</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L74"></a><tt class="py-lineno">  74</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">out</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L75"></a><tt class="py-lineno">  75</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">ndim</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L76"></a><tt class="py-lineno">  76</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L77"></a><tt class="py-lineno">  77</tt>  <tt class="py-line">            <tt class="py-name">data</tt> <tt class="py-op">*=</tt> <tt class="py-name">data</tt> </tt>
<a name="L78"></a><tt class="py-lineno">  78</tt>  <tt class="py-line">            <tt class="py-name">out</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">atleast_1d</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-name">axis</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L79"></a><tt class="py-lineno">  79</tt>  <tt class="py-line">            <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">out</tt><tt class="py-op">,</tt> <tt class="py-name">out</tt><tt class="py-op">)</tt> </tt>
<a name="L80"></a><tt class="py-lineno">  80</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">out</tt> </tt>
<a name="L81"></a><tt class="py-lineno">  81</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L82"></a><tt class="py-lineno">  82</tt>  <tt class="py-line">            <tt class="py-name">data</tt> <tt class="py-op">*=</tt> <tt class="py-name">data</tt> </tt>
<a name="L83"></a><tt class="py-lineno">  83</tt>  <tt class="py-line">            <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-name">axis</tt><tt class="py-op">,</tt> <tt class="py-name">out</tt><tt class="py-op">=</tt><tt class="py-name">out</tt><tt class="py-op">)</tt> </tt>
<a name="L84"></a><tt class="py-lineno">  84</tt>  <tt class="py-line">            <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">out</tt><tt class="py-op">,</tt> <tt class="py-name">out</tt><tt class="py-op">)</tt> </tt>
</div><a name="L85"></a><tt class="py-lineno">  85</tt>  <tt class="py-line"> </tt>
<a name="Helper.unit_vector"></a><div id="Helper.unit_vector-def"><a name="L86"></a><tt class="py-lineno">  86</tt> <a class="py-toggle" href="#" id="Helper.unit_vector-toggle" onclick="return toggle('Helper.unit_vector');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#unit_vector">unit_vector</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">data</tt><tt class="py-op">,</tt> <tt class="py-param">axis</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-param">out</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.unit_vector-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.unit_vector-expanded"><a name="L87"></a><tt class="py-lineno">  87</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return ndarray normalized by length, i.e. eucledian norm, along axis.</tt> </tt>
<a name="L88"></a><tt class="py-lineno">  88</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L89"></a><tt class="py-lineno">  89</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v0 = numpy.random.random(3)</tt> </tt>
<a name="L90"></a><tt class="py-lineno">  90</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = unit_vector(v0)</tt> </tt>
<a name="L91"></a><tt class="py-lineno">  91</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(v1, v0 / numpy.linalg.norm(v0))</tt> </tt>
<a name="L92"></a><tt class="py-lineno">  92</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L93"></a><tt class="py-lineno">  93</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v0 = numpy.random.rand(5, 4, 3)</tt> </tt>
<a name="L94"></a><tt class="py-lineno">  94</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = unit_vector(v0, axis=-1)</tt> </tt>
<a name="L95"></a><tt class="py-lineno">  95</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v2 = v0 / numpy.expand_dims(numpy.sqrt(numpy.sum(v0*v0, axis=2)), 2)</tt> </tt>
<a name="L96"></a><tt class="py-lineno">  96</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(v1, v2)</tt> </tt>
<a name="L97"></a><tt class="py-lineno">  97</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L98"></a><tt class="py-lineno">  98</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = unit_vector(v0, axis=1)</tt> </tt>
<a name="L99"></a><tt class="py-lineno">  99</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v2 = v0 / numpy.expand_dims(numpy.sqrt(numpy.sum(v0*v0, axis=1)), 1)</tt> </tt>
<a name="L100"></a><tt class="py-lineno"> 100</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(v1, v2)</tt> </tt>
<a name="L101"></a><tt class="py-lineno"> 101</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L102"></a><tt class="py-lineno"> 102</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = numpy.empty((5, 4, 3), dtype=numpy.float64)</tt> </tt>
<a name="L103"></a><tt class="py-lineno"> 103</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; unit_vector(v0, axis=1, out=v1)</tt> </tt>
<a name="L104"></a><tt class="py-lineno"> 104</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(v1, v2)</tt> </tt>
<a name="L105"></a><tt class="py-lineno"> 105</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L106"></a><tt class="py-lineno"> 106</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; list(unit_vector([]))</tt> </tt>
<a name="L107"></a><tt class="py-lineno"> 107</tt>  <tt class="py-line"><tt class="py-docstring">        []</tt> </tt>
<a name="L108"></a><tt class="py-lineno"> 108</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; list(unit_vector([1.0]))</tt> </tt>
<a name="L109"></a><tt class="py-lineno"> 109</tt>  <tt class="py-line"><tt class="py-docstring">        [1.0]</tt> </tt>
<a name="L110"></a><tt class="py-lineno"> 110</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L111"></a><tt class="py-lineno"> 111</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L112"></a><tt class="py-lineno"> 112</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">out</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L113"></a><tt class="py-lineno"> 113</tt>  <tt class="py-line">            <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L114"></a><tt class="py-lineno"> 114</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">data</tt><tt class="py-op">.</tt><tt class="py-name">ndim</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt><tt class="py-op">:</tt> </tt>
<a name="L115"></a><tt class="py-lineno"> 115</tt>  <tt class="py-line">                <tt class="py-name">data</tt> <tt class="py-op">/=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">data</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L116"></a><tt class="py-lineno"> 116</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">data</tt> </tt>
<a name="L117"></a><tt class="py-lineno"> 117</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L118"></a><tt class="py-lineno"> 118</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">out</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">data</tt><tt class="py-op">:</tt> </tt>
<a name="L119"></a><tt class="py-lineno"> 119</tt>  <tt class="py-line">                <tt class="py-name">out</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L120"></a><tt class="py-lineno"> 120</tt>  <tt class="py-line">            <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-name">out</tt> </tt>
<a name="L121"></a><tt class="py-lineno"> 121</tt>  <tt class="py-line">        <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">atleast_1d</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">data</tt><tt class="py-op">*</tt><tt class="py-name">data</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L122"></a><tt class="py-lineno"> 122</tt>  <tt class="py-line">        <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">length</tt><tt class="py-op">,</tt> <tt class="py-name">length</tt><tt class="py-op">)</tt> </tt>
<a name="L123"></a><tt class="py-lineno"> 123</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">axis</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L124"></a><tt class="py-lineno"> 124</tt>  <tt class="py-line">            <tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">expand_dims</tt><tt class="py-op">(</tt><tt class="py-name">length</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">)</tt> </tt>
<a name="L125"></a><tt class="py-lineno"> 125</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">/=</tt> <tt class="py-name">length</tt> </tt>
<a name="L126"></a><tt class="py-lineno"> 126</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">out</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L127"></a><tt class="py-lineno"> 127</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">data</tt> </tt>
</div><a name="L128"></a><tt class="py-lineno"> 128</tt>  <tt class="py-line"> </tt>
<a name="L129"></a><tt class="py-lineno"> 129</tt>  <tt class="py-line">     </tt>
<a name="Helper.norm"></a><div id="Helper.norm-def"><a name="L130"></a><tt class="py-lineno"> 130</tt> <a class="py-toggle" href="#" id="Helper.norm-toggle" onclick="return toggle('Helper.norm');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#norm">norm</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">a</tt> <tt class="py-op">,</tt><tt class="py-param">b</tt><tt class="py-op">,</tt><tt class="py-param">c</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.norm-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.norm-expanded"><a name="L131"></a><tt class="py-lineno"> 131</tt>  <tt class="py-line">        <tt class="py-docstring">""" result = math.sqrt( a*a + b*b + c*c)</tt> </tt>
<a name="L132"></a><tt class="py-lineno"> 132</tt>  <tt class="py-line"><tt class="py-docstring">        a,b,c being double</tt> </tt>
<a name="L133"></a><tt class="py-lineno"> 133</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L134"></a><tt class="py-lineno"> 134</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-name">a</tt> <tt class="py-op">+</tt> <tt class="py-name">b</tt><tt class="py-op">*</tt><tt class="py-name">b</tt> <tt class="py-op">+</tt> <tt class="py-name">c</tt><tt class="py-op">*</tt><tt class="py-name">c</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L135"></a><tt class="py-lineno"> 135</tt>  <tt class="py-line"> </tt>
<a name="Helper.normalize"></a><div id="Helper.normalize-def"><a name="L136"></a><tt class="py-lineno"> 136</tt> <a class="py-toggle" href="#" id="Helper.normalize-toggle" onclick="return toggle('Helper.normalize');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#normalize">normalize</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">A</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.normalize-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.normalize-expanded"><a name="L137"></a><tt class="py-lineno"> 137</tt>  <tt class="py-line">        <tt class="py-docstring">"""Normalize the Vector A"""</tt> </tt>
<a name="L138"></a><tt class="py-lineno"> 138</tt>  <tt class="py-line">        <tt id="link-13" class="py-name" targets="Method upy.hostHelper.Helper.norm()=upy.hostHelper.Helper-class.html#norm"><a title="upy.hostHelper.Helper.norm" class="py-name" href="#" onclick="return doclink('link-13', 'norm', 'link-13');">norm</a></tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt> <tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">A</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno"> 139</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt id="link-14" class="py-name"><a title="upy.hostHelper.Helper.norm" class="py-name" href="#" onclick="return doclink('link-14', 'norm', 'link-13');">norm</a></tt> <tt class="py-op">==</tt><tt class="py-number">0.0</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> <tt class="py-keyword">return</tt> <tt class="py-name">A</tt> </tt>
<a name="L140"></a><tt class="py-lineno"> 140</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt><tt class="py-keyword">return</tt> <tt class="py-name">A</tt><tt class="py-op">/</tt><tt id="link-15" class="py-name"><a title="upy.hostHelper.Helper.norm" class="py-name" href="#" onclick="return doclink('link-15', 'norm', 'link-13');">norm</a></tt> </tt>
</div><a name="L141"></a><tt class="py-lineno"> 141</tt>  <tt class="py-line">         </tt>
<a name="Helper.measure_distance"></a><div id="Helper.measure_distance-def"><a name="L142"></a><tt class="py-lineno"> 142</tt> <a class="py-toggle" href="#" id="Helper.measure_distance-toggle" onclick="return toggle('Helper.measure_distance');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#measure_distance">measure_distance</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">c0</tt><tt class="py-op">,</tt><tt class="py-param">c1</tt><tt class="py-op">,</tt><tt class="py-param">vec</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.measure_distance-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.measure_distance-expanded"><a name="L143"></a><tt class="py-lineno"> 143</tt>  <tt class="py-line">        <tt class="py-docstring">""" measure distance between 2 point specify by x,y,z</tt> </tt>
<a name="L144"></a><tt class="py-lineno"> 144</tt>  <tt class="py-line"><tt class="py-docstring">        c0,c1 should be Numeric.array"""</tt> </tt>
<a name="L145"></a><tt class="py-lineno"> 145</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt id="link-16" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-16', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">:</tt> </tt>
<a name="L146"></a><tt class="py-lineno"> 146</tt>  <tt class="py-line">            <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">c1</tt><tt class="py-op">)</tt> <tt class="py-op">-</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">c0</tt><tt class="py-op">)</tt> </tt>
<a name="L147"></a><tt class="py-lineno"> 147</tt>  <tt class="py-line">            <tt class="py-name">s</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">*</tt><tt class="py-name">d</tt><tt class="py-op">)</tt> </tt>
<a name="L148"></a><tt class="py-lineno"> 148</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L149"></a><tt class="py-lineno"> 149</tt>  <tt class="py-line">            <tt class="py-name">s</tt><tt class="py-op">=</tt><tt class="py-number">0.</tt> </tt>
<a name="L150"></a><tt class="py-lineno"> 150</tt>  <tt class="py-line">            <tt class="py-name">d</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt> </tt>
<a name="L151"></a><tt class="py-lineno"> 151</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L152"></a><tt class="py-lineno"> 152</tt>  <tt class="py-line">                <tt class="py-name">d</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">c1</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">c0</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L153"></a><tt class="py-lineno"> 153</tt>  <tt class="py-line">                <tt class="py-name">s</tt> <tt class="py-op">+=</tt> <tt class="py-name">d</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">^</tt><tt class="py-number">2</tt> </tt>
<a name="L154"></a><tt class="py-lineno"> 154</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">vec</tt> <tt class="py-op">:</tt> </tt>
<a name="L155"></a><tt class="py-lineno"> 155</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
<a name="L156"></a><tt class="py-lineno"> 156</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L157"></a><tt class="py-lineno"> 157</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">s</tt><tt class="py-op">)</tt> </tt>
</div><a name="L158"></a><tt class="py-lineno"> 158</tt>  <tt class="py-line"> </tt>
<a name="Helper.rotation_matrix"></a><div id="Helper.rotation_matrix-def"><a name="L159"></a><tt class="py-lineno"> 159</tt> <a class="py-toggle" href="#" id="Helper.rotation_matrix-toggle" onclick="return toggle('Helper.rotation_matrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#rotation_matrix">rotation_matrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">angle</tt><tt class="py-op">,</tt> <tt class="py-param">direction</tt><tt class="py-op">,</tt> <tt class="py-param">point</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.rotation_matrix-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.rotation_matrix-expanded"><a name="L160"></a><tt class="py-lineno"> 160</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return matrix to rotate about axis defined by point and direction.</tt> </tt>
<a name="L161"></a><tt class="py-lineno"> 161</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L162"></a><tt class="py-lineno"> 162</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; R = rotation_matrix(math.pi/2.0, [0, 0, 1], [1, 0, 0])</tt> </tt>
<a name="L163"></a><tt class="py-lineno"> 163</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(numpy.dot(R, [0, 0, 0, 1]), [ 1., -1.,  0.,  1.])</tt> </tt>
<a name="L164"></a><tt class="py-lineno"> 164</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L165"></a><tt class="py-lineno"> 165</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; angle = (random.random() - 0.5) * (2*math.pi)</tt> </tt>
<a name="L166"></a><tt class="py-lineno"> 166</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; direc = numpy.random.random(3) - 0.5</tt> </tt>
<a name="L167"></a><tt class="py-lineno"> 167</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; point = numpy.random.random(3) - 0.5</tt> </tt>
<a name="L168"></a><tt class="py-lineno"> 168</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; R0 = rotation_matrix(angle, direc, point)</tt> </tt>
<a name="L169"></a><tt class="py-lineno"> 169</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; R1 = rotation_matrix(angle-2*math.pi, direc, point)</tt> </tt>
<a name="L170"></a><tt class="py-lineno"> 170</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; is_same_transform(R0, R1)</tt> </tt>
<a name="L171"></a><tt class="py-lineno"> 171</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L172"></a><tt class="py-lineno"> 172</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; R0 = rotation_matrix(angle, direc, point)</tt> </tt>
<a name="L173"></a><tt class="py-lineno"> 173</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; R1 = rotation_matrix(-angle, -direc, point)</tt> </tt>
<a name="L174"></a><tt class="py-lineno"> 174</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; is_same_transform(R0, R1)</tt> </tt>
<a name="L175"></a><tt class="py-lineno"> 175</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L176"></a><tt class="py-lineno"> 176</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; I = numpy.identity(4, numpy.float64)</tt> </tt>
<a name="L177"></a><tt class="py-lineno"> 177</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(I, rotation_matrix(math.pi*2, direc))</tt> </tt>
<a name="L178"></a><tt class="py-lineno"> 178</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L179"></a><tt class="py-lineno"> 179</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(2., numpy.trace(rotation_matrix(math.pi/2,</tt> </tt>
<a name="L180"></a><tt class="py-lineno"> 180</tt>  <tt class="py-line"><tt class="py-docstring">        ...                                                direc, point)))</tt> </tt>
<a name="L181"></a><tt class="py-lineno"> 181</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L182"></a><tt class="py-lineno"> 182</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L183"></a><tt class="py-lineno"> 183</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L184"></a><tt class="py-lineno"> 184</tt>  <tt class="py-line">        <tt class="py-name">sina</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">angle</tt><tt class="py-op">)</tt> </tt>
<a name="L185"></a><tt class="py-lineno"> 185</tt>  <tt class="py-line">        <tt class="py-name">cosa</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">angle</tt><tt class="py-op">)</tt> </tt>
<a name="L186"></a><tt class="py-lineno"> 186</tt>  <tt class="py-line">        <tt class="py-name">direction</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-17" class="py-name" targets="Method upy.hostHelper.Helper.unit_vector()=upy.hostHelper.Helper-class.html#unit_vector"><a title="upy.hostHelper.Helper.unit_vector" class="py-name" href="#" onclick="return doclink('link-17', 'unit_vector', 'link-17');">unit_vector</a></tt><tt class="py-op">(</tt><tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L187"></a><tt class="py-lineno"> 187</tt>  <tt class="py-line">        <tt class="py-comment"># rotation matrix around unit vector</tt> </tt>
<a name="L188"></a><tt class="py-lineno"> 188</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">R</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">cosa</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt>  <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L189"></a><tt class="py-lineno"> 189</tt>  <tt class="py-line">                         <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt>  <tt class="py-name">cosa</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L190"></a><tt class="py-lineno"> 190</tt>  <tt class="py-line">                         <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt>  <tt class="py-number">0.0</tt><tt class="py-op">,</tt>  <tt class="py-name">cosa</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">)</tt> </tt>
<a name="L191"></a><tt class="py-lineno"> 191</tt>  <tt class="py-line">        <tt class="py-name">R</tt> <tt class="py-op">+=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">outer</tt><tt class="py-op">(</tt><tt class="py-name">direction</tt><tt class="py-op">,</tt> <tt class="py-name">direction</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-number">1.0</tt> <tt class="py-op">-</tt> <tt class="py-name">cosa</tt><tt class="py-op">)</tt> </tt>
<a name="L192"></a><tt class="py-lineno"> 192</tt>  <tt class="py-line">        <tt class="py-name">direction</tt> <tt class="py-op">*=</tt> <tt class="py-name">sina</tt> </tt>
<a name="L193"></a><tt class="py-lineno"> 193</tt>  <tt class="py-line">        <tt class="py-name">R</tt> <tt class="py-op">+=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-op">(</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt>         <tt class="py-op">-</tt><tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  <tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L194"></a><tt class="py-lineno"> 194</tt>  <tt class="py-line">                          <tt class="py-op">(</tt> <tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt>          <tt class="py-op">-</tt><tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L195"></a><tt class="py-lineno"> 195</tt>  <tt class="py-line">                          <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">direction</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L196"></a><tt class="py-lineno"> 196</tt>  <tt class="py-line">                         <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">)</tt> </tt>
<a name="L197"></a><tt class="py-lineno"> 197</tt>  <tt class="py-line">        <tt class="py-name">M</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">identity</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno"> 198</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">R</tt> </tt>
<a name="L199"></a><tt class="py-lineno"> 199</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">point</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L200"></a><tt class="py-lineno"> 200</tt>  <tt class="py-line">            <tt class="py-comment"># rotation not around origin</tt> </tt>
<a name="L201"></a><tt class="py-lineno"> 201</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">point</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">point</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L202"></a><tt class="py-lineno"> 202</tt>  <tt class="py-line">            <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">point</tt> <tt class="py-op">-</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">R</tt><tt class="py-op">,</tt> <tt class="py-name">point</tt><tt class="py-op">)</tt> </tt>
<a name="L203"></a><tt class="py-lineno"> 203</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">M</tt> </tt>
</div><a name="L204"></a><tt class="py-lineno"> 204</tt>  <tt class="py-line">     </tt>
<a name="L205"></a><tt class="py-lineno"> 205</tt>  <tt class="py-line"> </tt>
<a name="L206"></a><tt class="py-lineno"> 206</tt>  <tt class="py-line"> </tt>
<a name="Helper.rotate_about_axis"></a><div id="Helper.rotate_about_axis-def"><a name="L207"></a><tt class="py-lineno"> 207</tt> <a class="py-toggle" href="#" id="Helper.rotate_about_axis-toggle" onclick="return toggle('Helper.rotate_about_axis');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#rotate_about_axis">rotate_about_axis</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">B</tt><tt class="py-op">,</tt><tt class="py-param">theta</tt><tt class="py-op">,</tt><tt class="py-param">axis</tt><tt class="py-op">=</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.rotate_about_axis-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.rotate_about_axis-expanded"><a name="L208"></a><tt class="py-lineno"> 208</tt>  <tt class="py-line">        <tt class="py-comment">#from http://480.sagenb.org/home/pub/20/ </tt> </tt>
<a name="L209"></a><tt class="py-lineno"> 209</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># Create the rotation matrix. Rotation about the x-axis corresponds </tt> </tt>
<a name="L210"></a><tt class="py-lineno"> 210</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#to axis==0, y-axis to axis==1 and </tt> </tt>
<a name="L211"></a><tt class="py-lineno"> 211</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment"># z-axis to axis==2 </tt> </tt>
<a name="L212"></a><tt class="py-lineno"> 212</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">M</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt>  </tt>
<a name="L213"></a><tt class="py-lineno"> 213</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">axis</tt><tt class="py-op">==</tt><tt class="py-number">0</tt><tt class="py-op">:</tt>  </tt>
<a name="L214"></a><tt class="py-lineno"> 214</tt>  <tt class="py-line">            <tt class="py-name">M</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-string">'float128'</tt><tt class="py-op">)</tt>  </tt>
<a name="L215"></a><tt class="py-lineno"> 215</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">axis</tt><tt class="py-op">==</tt><tt class="py-number">1</tt><tt class="py-op">:</tt>  </tt>
<a name="L216"></a><tt class="py-lineno"> 216</tt>  <tt class="py-line">            <tt class="py-name">M</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-string">'float128'</tt><tt class="py-op">)</tt>  </tt>
<a name="L217"></a><tt class="py-lineno"> 217</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">axis</tt><tt class="py-op">==</tt><tt class="py-number">2</tt><tt class="py-op">:</tt>  </tt>
<a name="L218"></a><tt class="py-lineno"> 218</tt>  <tt class="py-line">            <tt class="py-name">M</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-string">'float128'</tt><tt class="py-op">)</tt>  </tt>
<a name="L219"></a><tt class="py-lineno"> 219</tt>  <tt class="py-line">        <tt class="py-comment"># Numpy makes large floating point matrix manipulations easy </tt> </tt>
<a name="L220"></a><tt class="py-lineno"> 220</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">M</tt><tt class="py-op">,</tt><tt class="py-name">B</tt><tt class="py-op">)</tt> </tt>
</div><a name="L221"></a><tt class="py-lineno"> 221</tt>  <tt class="py-line"> </tt>
<a name="Helper.randpoint_onsphere"></a><div id="Helper.randpoint_onsphere-def"><a name="L222"></a><tt class="py-lineno"> 222</tt> <a class="py-toggle" href="#" id="Helper.randpoint_onsphere-toggle" onclick="return toggle('Helper.randpoint_onsphere');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#randpoint_onsphere">randpoint_onsphere</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">,</tt><tt class="py-param">biased</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.randpoint_onsphere-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.randpoint_onsphere-expanded"><a name="L223"></a><tt class="py-lineno"> 223</tt>  <tt class="py-line">        <tt class="py-docstring">""" Generate a random point on the outside of a sphere.</tt> </tt>
<a name="L224"></a><tt class="py-lineno"> 224</tt>  <tt class="py-line"><tt class="py-docstring">        -points (x,y,z) so that (x-a)^2 +(y-b)^2 + (z-c)^2 = R^2</tt> </tt>
<a name="L225"></a><tt class="py-lineno"> 225</tt>  <tt class="py-line"><tt class="py-docstring">        -To generate a random point on the sphere, it is necessary only </tt> </tt>
<a name="L226"></a><tt class="py-lineno"> 226</tt>  <tt class="py-line"><tt class="py-docstring">        to generate two random numbers, z between -R and R, phi between </tt> </tt>
<a name="L227"></a><tt class="py-lineno"> 227</tt>  <tt class="py-line"><tt class="py-docstring">        0 and 2 pi, each with a uniform distribution</tt> </tt>
<a name="L228"></a><tt class="py-lineno"> 228</tt>  <tt class="py-line"><tt class="py-docstring">        To find the latitude (theta) of this point, note that z=R*sin(theta), </tt> </tt>
<a name="L229"></a><tt class="py-lineno"> 229</tt>  <tt class="py-line"><tt class="py-docstring">        so theta=sin-1(z/R); its longitude is (surprise!) phi.</tt> </tt>
<a name="L230"></a><tt class="py-lineno"> 230</tt>  <tt class="py-line"><tt class="py-docstring">        In rectilinear coordinates, </tt> </tt>
<a name="L231"></a><tt class="py-lineno"> 231</tt>  <tt class="py-line"><tt class="py-docstring">        tetha = asin-1(z/R)</tt> </tt>
<a name="L232"></a><tt class="py-lineno"> 232</tt>  <tt class="py-line"><tt class="py-docstring">        x=R*cos(theta)*cos(phi), </tt> </tt>
<a name="L233"></a><tt class="py-lineno"> 233</tt>  <tt class="py-line"><tt class="py-docstring">        y=R*cos(theta)*sin(phi), </tt> </tt>
<a name="L234"></a><tt class="py-lineno"> 234</tt>  <tt class="py-line"><tt class="py-docstring">        z=R*sin(theta)= (surprise!) z.</tt> </tt>
<a name="L235"></a><tt class="py-lineno"> 235</tt>  <tt class="py-line"><tt class="py-docstring">        -hemispher</tt> </tt>
<a name="L236"></a><tt class="py-lineno"> 236</tt>  <tt class="py-line"><tt class="py-docstring">        theta (0 &lt;= theta &lt; 360) and phi (0 &lt;= phi &lt;= pi/2)</tt> </tt>
<a name="L237"></a><tt class="py-lineno"> 237</tt>  <tt class="py-line"><tt class="py-docstring">        x = cos(sqrt(phi)) cos(theta)</tt> </tt>
<a name="L238"></a><tt class="py-lineno"> 238</tt>  <tt class="py-line"><tt class="py-docstring">        y = cos(sqrt(phi)) sin(theta)</tt> </tt>
<a name="L239"></a><tt class="py-lineno"> 239</tt>  <tt class="py-line"><tt class="py-docstring">        z = sin(sqrt(phi)) </tt> </tt>
<a name="L240"></a><tt class="py-lineno"> 240</tt>  <tt class="py-line"><tt class="py-docstring">        A whole sphere is obtained by simply randomising the sign of z. </tt> </tt>
<a name="L241"></a><tt class="py-lineno"> 241</tt>  <tt class="py-line"><tt class="py-docstring">        -Azimuth axis is X axis. The elevation angle is measured as the angle </tt> </tt>
<a name="L242"></a><tt class="py-lineno"> 242</tt>  <tt class="py-line"><tt class="py-docstring">        between the Z-axis pointing upwards and the radius vector. </tt> </tt>
<a name="L243"></a><tt class="py-lineno"> 243</tt>  <tt class="py-line"><tt class="py-docstring">        From elementary spherical geometry:</tt> </tt>
<a name="L244"></a><tt class="py-lineno"> 244</tt>  <tt class="py-line"><tt class="py-docstring">            X coordinate=r*cos(pi/2-el)*cos(az)</tt> </tt>
<a name="L245"></a><tt class="py-lineno"> 245</tt>  <tt class="py-line"><tt class="py-docstring">            Y coordinate=r*cos(pi/2-el)*sin(az)</tt> </tt>
<a name="L246"></a><tt class="py-lineno"> 246</tt>  <tt class="py-line"><tt class="py-docstring">            Z Coordinate=r*sin(pi/2-el)</tt> </tt>
<a name="L247"></a><tt class="py-lineno"> 247</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L248"></a><tt class="py-lineno"> 248</tt>  <tt class="py-line"><tt class="py-docstring">            r=1.1;</tt> </tt>
<a name="L249"></a><tt class="py-lineno"> 249</tt>  <tt class="py-line"><tt class="py-docstring">            az=pi/4;</tt> </tt>
<a name="L250"></a><tt class="py-lineno"> 250</tt>  <tt class="py-line"><tt class="py-docstring">            el=pi/4;</tt> </tt>
<a name="L251"></a><tt class="py-lineno"> 251</tt>  <tt class="py-line"><tt class="py-docstring">            plot3(r*sin(az)*cos(el), r*sin(az)*sin(el), r*cos(az), 'k*', 'MarkerSize',10</tt> </tt>
<a name="L252"></a><tt class="py-lineno"> 252</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L253"></a><tt class="py-lineno"> 253</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">biased</tt> <tt class="py-keyword">is</tt> <tt class="py-keyword">not</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L254"></a><tt class="py-lineno"> 254</tt>  <tt class="py-line">            <tt class="py-name">theta</tt> <tt class="py-op">=</tt> <tt class="py-name">biased</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt id="link-18" class="py-name" targets="Variable upy.hostHelper.pi=upy.hostHelper-module.html#pi"><a title="upy.hostHelper.pi" class="py-name" href="#" onclick="return doclink('link-18', 'pi', 'link-18');">pi</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L255"></a><tt class="py-lineno"> 255</tt>  <tt class="py-line">            <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-name">biased</tt> <tt class="py-op">*</tt> <tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt> <tt class="py-comment">#represent sin(phi)</tt> </tt>
<a name="L256"></a><tt class="py-lineno"> 256</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L257"></a><tt class="py-lineno"> 257</tt>  <tt class="py-line">            <tt class="py-name">theta</tt> <tt class="py-op">=</tt> <tt class="py-name">random</tt><tt class="py-op">.</tt><tt class="py-name">random</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt> <tt class="py-number">2</tt> <tt class="py-op">*</tt> <tt id="link-19" class="py-name"><a title="upy.hostHelper.pi" class="py-name" href="#" onclick="return doclink('link-19', 'pi', 'link-18');">pi</a></tt> <tt class="py-op">)</tt> </tt>
<a name="L258"></a><tt class="py-lineno"> 258</tt>  <tt class="py-line">            <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-name">random</tt><tt class="py-op">.</tt><tt class="py-name">random</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-number">2</tt> <tt class="py-op">-</tt> <tt class="py-number">1</tt> </tt>
<a name="L259"></a><tt class="py-lineno"> 259</tt>  <tt class="py-line">        <tt id="link-20" class="py-name" targets="Variable upy.uiAdaptor.uiAdaptor.x=upy.uiAdaptor.uiAdaptor-class.html#x"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-20', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-name">sqrt</tt><tt class="py-op">(</tt>  <tt class="py-number">1</tt> <tt class="py-op">-</tt> <tt class="py-name">u</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt> </tt>
<a name="L260"></a><tt class="py-lineno"> 260</tt>  <tt class="py-line">        <tt id="link-21" class="py-name" targets="Variable upy.uiAdaptor.uiAdaptor.y=upy.uiAdaptor.uiAdaptor-class.html#y"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-21', 'y', 'link-21');">y</a></tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-name">sqrt</tt><tt class="py-op">(</tt>  <tt class="py-number">1</tt> <tt class="py-op">-</tt> <tt class="py-name">u</tt><tt class="py-op">**</tt><tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">theta</tt><tt class="py-op">)</tt> </tt>
<a name="L261"></a><tt class="py-lineno"> 261</tt>  <tt class="py-line">        <tt class="py-name">z</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-name">u</tt> </tt>
<a name="L262"></a><tt class="py-lineno"> 262</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt id="link-22" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-22', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-23" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-23', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt> </tt>
</div><a name="L263"></a><tt class="py-lineno"> 263</tt>  <tt class="py-line"> </tt>
<a name="Helper.angle_between_vectors"></a><div id="Helper.angle_between_vectors-def"><a name="L264"></a><tt class="py-lineno"> 264</tt> <a class="py-toggle" href="#" id="Helper.angle_between_vectors-toggle" onclick="return toggle('Helper.angle_between_vectors');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#angle_between_vectors">angle_between_vectors</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">v0</tt><tt class="py-op">,</tt> <tt class="py-param">v1</tt><tt class="py-op">,</tt> <tt class="py-param">directed</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">axis</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.angle_between_vectors-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.angle_between_vectors-expanded"><a name="L265"></a><tt class="py-lineno"> 265</tt>  <tt class="py-line">        <tt class="py-docstring">"""Return angle between vectors.</tt> </tt>
<a name="L266"></a><tt class="py-lineno"> 266</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L267"></a><tt class="py-lineno"> 267</tt>  <tt class="py-line"><tt class="py-docstring">        If directed is False, the input vectors are interpreted as undirected axes,</tt> </tt>
<a name="L268"></a><tt class="py-lineno"> 268</tt>  <tt class="py-line"><tt class="py-docstring">        i.e. the maximum angle is pi/2.</tt> </tt>
<a name="L269"></a><tt class="py-lineno"> 269</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L270"></a><tt class="py-lineno"> 270</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; a = angle_between_vectors([1, -2, 3], [-1, 2, -3])</tt> </tt>
<a name="L271"></a><tt class="py-lineno"> 271</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(a, math.pi)</tt> </tt>
<a name="L272"></a><tt class="py-lineno"> 272</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L273"></a><tt class="py-lineno"> 273</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; a = angle_between_vectors([1, -2, 3], [-1, 2, -3], directed=False)</tt> </tt>
<a name="L274"></a><tt class="py-lineno"> 274</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(a, 0)</tt> </tt>
<a name="L275"></a><tt class="py-lineno"> 275</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L276"></a><tt class="py-lineno"> 276</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v0 = [[2, 0, 0, 2], [0, 2, 0, 2], [0, 0, 2, 2]]</tt> </tt>
<a name="L277"></a><tt class="py-lineno"> 277</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = [[3], [0], [0]]</tt> </tt>
<a name="L278"></a><tt class="py-lineno"> 278</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; a = angle_between_vectors(v0, v1)</tt> </tt>
<a name="L279"></a><tt class="py-lineno"> 279</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(a, [0., 1.5708, 1.5708, 0.95532])</tt> </tt>
<a name="L280"></a><tt class="py-lineno"> 280</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L281"></a><tt class="py-lineno"> 281</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v0 = [[2, 0, 0], [2, 0, 0], [0, 2, 0], [2, 0, 0]]</tt> </tt>
<a name="L282"></a><tt class="py-lineno"> 282</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; v1 = [[0, 3, 0], [0, 0, 3], [0, 0, 3], [3, 3, 3]]</tt> </tt>
<a name="L283"></a><tt class="py-lineno"> 283</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; a = angle_between_vectors(v0, v1, axis=1)</tt> </tt>
<a name="L284"></a><tt class="py-lineno"> 284</tt>  <tt class="py-line"><tt class="py-docstring">        &gt;&gt;&gt; numpy.allclose(a, [1.5708, 1.5708, 1.5708, 0.95532])</tt> </tt>
<a name="L285"></a><tt class="py-lineno"> 285</tt>  <tt class="py-line"><tt class="py-docstring">        True</tt> </tt>
<a name="L286"></a><tt class="py-lineno"> 286</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L287"></a><tt class="py-lineno"> 287</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L288"></a><tt class="py-lineno"> 288</tt>  <tt class="py-line">        <tt class="py-name">v0</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">v0</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L289"></a><tt class="py-lineno"> 289</tt>  <tt class="py-line">        <tt class="py-name">v1</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">v1</tt><tt class="py-op">,</tt> <tt class="py-name">dtype</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">float64</tt><tt class="py-op">,</tt> <tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L290"></a><tt class="py-lineno"> 290</tt>  <tt class="py-line">        <tt class="py-name">dot</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">v0</tt> <tt class="py-op">*</tt> <tt class="py-name">v1</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-name">axis</tt><tt class="py-op">)</tt> </tt>
<a name="L291"></a><tt class="py-lineno"> 291</tt>  <tt class="py-line">        <tt class="py-name">dot</tt> <tt class="py-op">/=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-24" class="py-name" targets="Method upy.hostHelper.Helper.vector_norm()=upy.hostHelper.Helper-class.html#vector_norm"><a title="upy.hostHelper.Helper.vector_norm" class="py-name" href="#" onclick="return doclink('link-24', 'vector_norm', 'link-24');">vector_norm</a></tt><tt class="py-op">(</tt><tt class="py-name">v0</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-name">axis</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-25" class="py-name"><a title="upy.hostHelper.Helper.vector_norm" class="py-name" href="#" onclick="return doclink('link-25', 'vector_norm', 'link-24');">vector_norm</a></tt><tt class="py-op">(</tt><tt class="py-name">v1</tt><tt class="py-op">,</tt> <tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-name">axis</tt><tt class="py-op">)</tt> </tt>
<a name="L292"></a><tt class="py-lineno"> 292</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">arccos</tt><tt class="py-op">(</tt><tt class="py-name">dot</tt> <tt class="py-keyword">if</tt> <tt class="py-name">directed</tt> <tt class="py-keyword">else</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">fabs</tt><tt class="py-op">(</tt><tt class="py-name">dot</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L293"></a><tt class="py-lineno"> 293</tt>  <tt class="py-line"> </tt>
<a name="L294"></a><tt class="py-lineno"> 294</tt>  <tt class="py-line"> </tt>
<a name="Helper.rotatePoint"></a><div id="Helper.rotatePoint-def"><a name="L295"></a><tt class="py-lineno"> 295</tt> <a class="py-toggle" href="#" id="Helper.rotatePoint-toggle" onclick="return toggle('Helper.rotatePoint');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#rotatePoint">rotatePoint</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">pt</tt><tt class="py-op">,</tt><tt class="py-param">m</tt><tt class="py-op">,</tt><tt class="py-param">ax</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.rotatePoint-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.rotatePoint-expanded"><a name="L296"></a><tt class="py-lineno"> 296</tt>  <tt class="py-line">        <tt class="py-docstring">""" rotate the point pt [x,y,z] around axe ax[0],ax[1],ax[2] by ax[3] radians,</tt> </tt>
<a name="L297"></a><tt class="py-lineno"> 297</tt>  <tt class="py-line"><tt class="py-docstring">        and translate by m [x,y,z].</tt> </tt>
<a name="L298"></a><tt class="py-lineno"> 298</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L299"></a><tt class="py-lineno"> 299</tt>  <tt class="py-line">        <tt id="link-26" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-26', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L300"></a><tt class="py-lineno"> 300</tt>  <tt class="py-line">        <tt id="link-27" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-27', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L301"></a><tt class="py-lineno"> 301</tt>  <tt class="py-line">        <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L302"></a><tt class="py-lineno"> 302</tt>  <tt class="py-line">        <tt class="py-name">u</tt><tt class="py-op">=</tt><tt class="py-name">ax</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L303"></a><tt class="py-lineno"> 303</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">=</tt><tt class="py-name">ax</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L304"></a><tt class="py-lineno"> 304</tt>  <tt class="py-line">        <tt class="py-name">w</tt><tt class="py-op">=</tt><tt class="py-name">ax</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L305"></a><tt class="py-lineno"> 305</tt>  <tt class="py-line">        <tt class="py-name">ux</tt><tt class="py-op">=</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt id="link-28" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-28', 'x', 'link-20');">x</a></tt> </tt>
<a name="L306"></a><tt class="py-lineno"> 306</tt>  <tt class="py-line">        <tt class="py-name">uy</tt><tt class="py-op">=</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt id="link-29" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-29', 'y', 'link-21');">y</a></tt> </tt>
<a name="L307"></a><tt class="py-lineno"> 307</tt>  <tt class="py-line">        <tt class="py-name">uz</tt><tt class="py-op">=</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">z</tt> </tt>
<a name="L308"></a><tt class="py-lineno"> 308</tt>  <tt class="py-line">        <tt class="py-name">vx</tt><tt class="py-op">=</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt id="link-30" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-30', 'x', 'link-20');">x</a></tt> </tt>
<a name="L309"></a><tt class="py-lineno"> 309</tt>  <tt class="py-line">        <tt class="py-name">vy</tt><tt class="py-op">=</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt id="link-31" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-31', 'y', 'link-21');">y</a></tt> </tt>
<a name="L310"></a><tt class="py-lineno"> 310</tt>  <tt class="py-line">        <tt class="py-name">vz</tt><tt class="py-op">=</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt class="py-name">z</tt> </tt>
<a name="L311"></a><tt class="py-lineno"> 311</tt>  <tt class="py-line">        <tt class="py-name">wx</tt><tt class="py-op">=</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt id="link-32" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-32', 'x', 'link-20');">x</a></tt> </tt>
<a name="L312"></a><tt class="py-lineno"> 312</tt>  <tt class="py-line">        <tt class="py-name">wy</tt><tt class="py-op">=</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt id="link-33" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-33', 'y', 'link-21');">y</a></tt> </tt>
<a name="L313"></a><tt class="py-lineno"> 313</tt>  <tt class="py-line">        <tt class="py-name">wz</tt><tt class="py-op">=</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-name">z</tt> </tt>
<a name="L314"></a><tt class="py-lineno"> 314</tt>  <tt class="py-line">        <tt class="py-name">sa</tt><tt class="py-op">=</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">ax</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L315"></a><tt class="py-lineno"> 315</tt>  <tt class="py-line">        <tt class="py-name">ca</tt><tt class="py-op">=</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">ax</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L316"></a><tt class="py-lineno"> 316</tt>  <tt class="py-line">        <tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">ux</tt><tt class="py-op">+</tt><tt class="py-name">vy</tt><tt class="py-op">+</tt><tt class="py-name">wz</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt id="link-34" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-34', 'x', 'link-20');">x</a></tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">+</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-name">w</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">vy</tt><tt class="py-op">+</tt><tt class="py-name">wz</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">ca</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">wy</tt><tt class="py-op">+</tt><tt class="py-name">vz</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">)</tt><tt class="py-op">+</tt> <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L317"></a><tt class="py-lineno"> 317</tt>  <tt class="py-line">        <tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">ux</tt><tt class="py-op">+</tt><tt class="py-name">vy</tt><tt class="py-op">+</tt><tt class="py-name">wz</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt id="link-35" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-35', 'y', 'link-21');">y</a></tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">+</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-name">w</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">ux</tt><tt class="py-op">+</tt><tt class="py-name">wz</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">ca</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-name">wx</tt><tt class="py-op">-</tt><tt class="py-name">uz</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">)</tt><tt class="py-op">+</tt> <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L318"></a><tt class="py-lineno"> 318</tt>  <tt class="py-line">        <tt class="py-name">pt</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">ux</tt><tt class="py-op">+</tt><tt class="py-name">vy</tt><tt class="py-op">+</tt><tt class="py-name">wz</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-name">z</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">*</tt><tt class="py-name">u</tt><tt class="py-op">+</tt><tt class="py-name">v</tt><tt class="py-op">*</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-name">w</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">ux</tt><tt class="py-op">+</tt><tt class="py-name">vy</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">ca</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">vx</tt><tt class="py-op">+</tt><tt class="py-name">uy</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">)</tt><tt class="py-op">+</tt> <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L319"></a><tt class="py-lineno"> 319</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">pt</tt> </tt>
</div><a name="L320"></a><tt class="py-lineno"> 320</tt>  <tt class="py-line"> </tt>
<a name="Helper.eulerToMatrix"></a><div id="Helper.eulerToMatrix-def"><a name="L321"></a><tt class="py-lineno"> 321</tt> <a class="py-toggle" href="#" id="Helper.eulerToMatrix-toggle" onclick="return toggle('Helper.eulerToMatrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#eulerToMatrix">eulerToMatrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">euler</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment">#double heading, double attitude, double bank</tt> </tt>
</div><a name="L322"></a><tt class="py-lineno"> 322</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L323"></a><tt class="py-lineno"> 323</tt>  <tt class="py-line"><tt class="py-docstring">        code from 'http://www.euclideanspace.com/maths/geometry/rotations/conversions/'.</tt> </tt>
<a name="L324"></a><tt class="py-lineno"> 324</tt>  <tt class="py-line"><tt class="py-docstring">        this conversion uses NASA standard aeroplane conventions as described on page:</tt> </tt>
<a name="L325"></a><tt class="py-lineno"> 325</tt>  <tt class="py-line"><tt class="py-docstring">        'http://www.euclideanspace.com/maths/geometry/rotations/euler/index.htm'</tt> </tt>
<a name="L326"></a><tt class="py-lineno"> 326</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L327"></a><tt class="py-lineno"> 327</tt>  <tt class="py-line"><tt class="py-docstring">        Coordinate System: right hand</tt> </tt>
<a name="L328"></a><tt class="py-lineno"> 328</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L329"></a><tt class="py-lineno"> 329</tt>  <tt class="py-line"><tt class="py-docstring">        Positive angle: right hand</tt> </tt>
<a name="L330"></a><tt class="py-lineno"> 330</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L331"></a><tt class="py-lineno"> 331</tt>  <tt class="py-line"><tt class="py-docstring">        Order of euler angles: heading first, then attitude, then bank</tt> </tt>
<a name="L332"></a><tt class="py-lineno"> 332</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L333"></a><tt class="py-lineno"> 333</tt>  <tt class="py-line"><tt class="py-docstring">        matrix row column ordering:</tt> </tt>
<a name="L334"></a><tt class="py-lineno"> 334</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L335"></a><tt class="py-lineno"> 335</tt>  <tt class="py-line"><tt class="py-docstring">        [m00 m01 m02]</tt> </tt>
<a name="L336"></a><tt class="py-lineno"> 336</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L337"></a><tt class="py-lineno"> 337</tt>  <tt class="py-line"><tt class="py-docstring">        [m10 m11 m12]</tt> </tt>
<a name="L338"></a><tt class="py-lineno"> 338</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L339"></a><tt class="py-lineno"> 339</tt>  <tt class="py-line"><tt class="py-docstring">        [m20 m21 m22]</tt> </tt>
<a name="L340"></a><tt class="py-lineno"> 340</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L341"></a><tt class="py-lineno"> 341</tt>  <tt class="py-line"><tt class="py-docstring">        @type euler:   3d array</tt> </tt>
<a name="L342"></a><tt class="py-lineno"> 342</tt>  <tt class="py-line"><tt class="py-docstring">        @param euler:  the euler angle to convert in matrice</tt> </tt>
<a name="L343"></a><tt class="py-lineno"> 343</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L344"></a><tt class="py-lineno"> 344</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype: 4x4array</tt> </tt>
<a name="L345"></a><tt class="py-lineno"> 345</tt>  <tt class="py-line"><tt class="py-docstring">        @return: the matrix computed from the euler angle</tt> </tt>
<a name="L346"></a><tt class="py-lineno"> 346</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L347"></a><tt class="py-lineno"> 347</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L348"></a><tt class="py-lineno"> 348</tt>  <tt class="py-line">        <tt class="py-comment"># Assuming the angles are in radians.</tt> </tt>
<a name="L349"></a><tt class="py-lineno"> 349</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">import</tt> <tt class="py-name">math</tt> </tt>
<a name="L350"></a><tt class="py-lineno"> 350</tt>  <tt class="py-line">        <tt class="py-name">heading</tt><tt class="py-op">=</tt><tt class="py-name">euler</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L351"></a><tt class="py-lineno"> 351</tt>  <tt class="py-line">        <tt class="py-name">attitude</tt><tt class="py-op">=</tt><tt class="py-name">euler</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L352"></a><tt class="py-lineno"> 352</tt>  <tt class="py-line">        <tt class="py-name">bank</tt><tt class="py-op">=</tt><tt class="py-name">euler</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L353"></a><tt class="py-lineno"> 353</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt> <tt class="py-number">1.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L354"></a><tt class="py-lineno"> 354</tt>  <tt class="py-line">           <tt class="py-op">[</tt> <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">1.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L355"></a><tt class="py-lineno"> 355</tt>  <tt class="py-line">           <tt class="py-op">[</tt> <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">1.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L356"></a><tt class="py-lineno"> 356</tt>  <tt class="py-line">           <tt class="py-op">[</tt> <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">0.</tt><tt class="py-op">,</tt>  <tt class="py-number">1.</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L357"></a><tt class="py-lineno"> 357</tt>  <tt class="py-line">        <tt class="py-name">ch</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">heading</tt><tt class="py-op">)</tt> </tt>
<a name="L358"></a><tt class="py-lineno"> 358</tt>  <tt class="py-line">        <tt class="py-name">sh</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">heading</tt><tt class="py-op">)</tt> </tt>
<a name="L359"></a><tt class="py-lineno"> 359</tt>  <tt class="py-line">        <tt class="py-name">ca</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">attitude</tt><tt class="py-op">)</tt> </tt>
<a name="L360"></a><tt class="py-lineno"> 360</tt>  <tt class="py-line">        <tt class="py-name">sa</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">attitude</tt><tt class="py-op">)</tt> </tt>
<a name="L361"></a><tt class="py-lineno"> 361</tt>  <tt class="py-line">        <tt class="py-name">cb</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">bank</tt><tt class="py-op">)</tt> </tt>
<a name="L362"></a><tt class="py-lineno"> 362</tt>  <tt class="py-line">        <tt class="py-name">sb</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">bank</tt><tt class="py-op">)</tt> </tt>
<a name="L363"></a><tt class="py-lineno"> 363</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">ch</tt> <tt class="py-op">*</tt> <tt class="py-name">ca</tt> </tt>
<a name="L364"></a><tt class="py-lineno"> 364</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">sh</tt><tt class="py-op">*</tt><tt class="py-name">sb</tt> <tt class="py-op">-</tt> <tt class="py-name">ch</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">*</tt><tt class="py-name">cb</tt> </tt>
<a name="L365"></a><tt class="py-lineno"> 365</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">ch</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">*</tt><tt class="py-name">sb</tt> <tt class="py-op">+</tt> <tt class="py-name">sh</tt><tt class="py-op">*</tt><tt class="py-name">cb</tt> </tt>
<a name="L366"></a><tt class="py-lineno"> 366</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">sa</tt> </tt>
<a name="L367"></a><tt class="py-lineno"> 367</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">ca</tt><tt class="py-op">*</tt><tt class="py-name">cb</tt> </tt>
<a name="L368"></a><tt class="py-lineno"> 368</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-name">ca</tt><tt class="py-op">*</tt><tt class="py-name">sb</tt> </tt>
<a name="L369"></a><tt class="py-lineno"> 369</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-name">sh</tt><tt class="py-op">*</tt><tt class="py-name">ca</tt> </tt>
<a name="L370"></a><tt class="py-lineno"> 370</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">sh</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">*</tt><tt class="py-name">cb</tt> <tt class="py-op">+</tt> <tt class="py-name">ch</tt><tt class="py-op">*</tt><tt class="py-name">sb</tt> </tt>
<a name="L371"></a><tt class="py-lineno"> 371</tt>  <tt class="py-line">        <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">-</tt><tt class="py-name">sh</tt><tt class="py-op">*</tt><tt class="py-name">sa</tt><tt class="py-op">*</tt><tt class="py-name">sb</tt> <tt class="py-op">+</tt> <tt class="py-name">ch</tt><tt class="py-op">*</tt><tt class="py-name">cb</tt> </tt>
<a name="L372"></a><tt class="py-lineno"> 372</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">m</tt> </tt>
</div><a name="L373"></a><tt class="py-lineno"> 373</tt>  <tt class="py-line">         </tt>
<a name="Helper.ApplyMatrix"></a><div id="Helper.ApplyMatrix-def"><a name="L374"></a><tt class="py-lineno"> 374</tt> <a class="py-toggle" href="#" id="Helper.ApplyMatrix-toggle" onclick="return toggle('Helper.ApplyMatrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#ApplyMatrix">ApplyMatrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">coords</tt><tt class="py-op">,</tt><tt class="py-param">mat</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.ApplyMatrix-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.ApplyMatrix-expanded"><a name="L375"></a><tt class="py-lineno"> 375</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L376"></a><tt class="py-lineno"> 376</tt>  <tt class="py-line"><tt class="py-docstring">        Apply the 4x4 transformation matrix to the given list of 3d points</tt> </tt>
<a name="L377"></a><tt class="py-lineno"> 377</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L378"></a><tt class="py-lineno"> 378</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: array</tt> </tt>
<a name="L379"></a><tt class="py-lineno"> 379</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: the list of point to transform.</tt> </tt>
<a name="L380"></a><tt class="py-lineno"> 380</tt>  <tt class="py-line"><tt class="py-docstring">        @type  mat: 4x4array</tt> </tt>
<a name="L381"></a><tt class="py-lineno"> 381</tt>  <tt class="py-line"><tt class="py-docstring">        @param mat: the matrix to apply to the 3d points</tt> </tt>
<a name="L382"></a><tt class="py-lineno"> 382</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L383"></a><tt class="py-lineno"> 383</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   array</tt> </tt>
<a name="L384"></a><tt class="py-lineno"> 384</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the transformed list of 3d points</tt> </tt>
<a name="L385"></a><tt class="py-lineno"> 385</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L386"></a><tt class="py-lineno"> 386</tt>  <tt class="py-line">     </tt>
<a name="L387"></a><tt class="py-lineno"> 387</tt>  <tt class="py-line">        <tt class="py-comment">#4x4matrix"</tt> </tt>
<a name="L388"></a><tt class="py-lineno"> 388</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">mat</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">mat</tt><tt class="py-op">)</tt> </tt>
<a name="L389"></a><tt class="py-lineno"> 389</tt>  <tt class="py-line">        <tt class="py-name">coords</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt> </tt>
<a name="L390"></a><tt class="py-lineno"> 390</tt>  <tt class="py-line">        <tt class="py-name">one</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">ones</tt><tt class="py-op">(</tt> <tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">coords</tt><tt class="py-op">.</tt><tt class="py-name">dtype</tt><tt class="py-op">.</tt><tt class="py-name">char</tt> <tt class="py-op">)</tt> </tt>
<a name="L391"></a><tt class="py-lineno"> 391</tt>  <tt class="py-line">        <tt class="py-name">c</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">concatenate</tt><tt class="py-op">(</tt> <tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">,</tt> <tt class="py-name">one</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt> <tt class="py-op">)</tt> </tt>
<a name="L392"></a><tt class="py-lineno"> 392</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">dot</tt><tt class="py-op">(</tt><tt class="py-name">c</tt><tt class="py-op">,</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">transpose</tt><tt class="py-op">(</tt><tt class="py-name">mat</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt> <tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> </tt>
</div><a name="L393"></a><tt class="py-lineno"> 393</tt>  <tt class="py-line"> </tt>
<a name="L394"></a><tt class="py-lineno"> 394</tt>  <tt class="py-line"> </tt>
<a name="Helper.Decompose4x4"></a><div id="Helper.Decompose4x4-def"><a name="L395"></a><tt class="py-lineno"> 395</tt> <a class="py-toggle" href="#" id="Helper.Decompose4x4-toggle" onclick="return toggle('Helper.Decompose4x4');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Decompose4x4">Decompose4x4</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">matrix</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Decompose4x4-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Decompose4x4-expanded"><a name="L396"></a><tt class="py-lineno"> 396</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L397"></a><tt class="py-lineno"> 397</tt>  <tt class="py-line"><tt class="py-docstring">        Takes a matrix in shape (16,) in OpenGL form (sequential values go</tt> </tt>
<a name="L398"></a><tt class="py-lineno"> 398</tt>  <tt class="py-line"><tt class="py-docstring">        down columns) and decomposes it into its rotation (shape (16,)),</tt> </tt>
<a name="L399"></a><tt class="py-lineno"> 399</tt>  <tt class="py-line"><tt class="py-docstring">        translation (shape (3,)), and scale (shape (3,))</tt> </tt>
<a name="L400"></a><tt class="py-lineno"> 400</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L401"></a><tt class="py-lineno"> 401</tt>  <tt class="py-line"><tt class="py-docstring">        @type  matrix: 4x4array</tt> </tt>
<a name="L402"></a><tt class="py-lineno"> 402</tt>  <tt class="py-line"><tt class="py-docstring">        @param matrix: the matrix to decompose</tt> </tt>
<a name="L403"></a><tt class="py-lineno"> 403</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L404"></a><tt class="py-lineno"> 404</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list of array</tt> </tt>
<a name="L405"></a><tt class="py-lineno"> 405</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the decomposition of the matrix ie : rotation,translation,scale</tt> </tt>
<a name="L406"></a><tt class="py-lineno"> 406</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L407"></a><tt class="py-lineno"> 407</tt>  <tt class="py-line">        <tt class="py-name">m</tt> <tt class="py-op">=</tt> <tt class="py-name">matrix</tt> </tt>
<a name="L408"></a><tt class="py-lineno"> 408</tt>  <tt class="py-line">        <tt class="py-name">transl</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">12</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">13</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">14</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L409"></a><tt class="py-lineno"> 409</tt>  <tt class="py-line">        <tt class="py-name">scale0</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">8</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">8</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L410"></a><tt class="py-lineno"> 410</tt>  <tt class="py-line">        <tt class="py-name">scale1</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">9</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">9</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L411"></a><tt class="py-lineno"> 411</tt>  <tt class="py-line">        <tt class="py-name">scale2</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">6</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">m</tt><tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L412"></a><tt class="py-lineno"> 412</tt>  <tt class="py-line">        <tt class="py-name">scale</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">scale0</tt><tt class="py-op">,</tt><tt class="py-name">scale1</tt><tt class="py-op">,</tt><tt class="py-name">scale2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L413"></a><tt class="py-lineno"> 413</tt>  <tt class="py-line">        <tt class="py-name">mat</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">reshape</tt><tt class="py-op">(</tt><tt class="py-name">m</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L414"></a><tt class="py-lineno"> 414</tt>  <tt class="py-line">        <tt class="py-name">rot</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">identity</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L415"></a><tt class="py-lineno"> 415</tt>  <tt class="py-line">        <tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">mat</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L416"></a><tt class="py-lineno"> 416</tt>  <tt class="py-line">        <tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-name">scale0</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L417"></a><tt class="py-lineno"> 417</tt>  <tt class="py-line">        <tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-name">scale1</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L418"></a><tt class="py-lineno"> 418</tt>  <tt class="py-line">        <tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">rot</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-name">scale2</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">astype</tt><tt class="py-op">(</tt><tt class="py-string">'f'</tt><tt class="py-op">)</tt> </tt>
<a name="L419"></a><tt class="py-lineno"> 419</tt>  <tt class="py-line">        <tt class="py-name">rot</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-number">16</tt><tt class="py-op">,</tt><tt class="py-op">)</tt> </tt>
<a name="L420"></a><tt class="py-lineno"> 420</tt>  <tt class="py-line">        <tt class="py-comment">#rot1 = rot.astype('f')</tt> </tt>
<a name="L421"></a><tt class="py-lineno"> 421</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">rot</tt><tt class="py-op">,</tt> <tt class="py-name">transl</tt><tt class="py-op">,</tt> <tt class="py-name">scale</tt> </tt>
</div><a name="L422"></a><tt class="py-lineno"> 422</tt>  <tt class="py-line"> </tt>
<a name="Helper.getTubeProperties"></a><div id="Helper.getTubeProperties-def"><a name="L423"></a><tt class="py-lineno"> 423</tt> <a class="py-toggle" href="#" id="Helper.getTubeProperties-toggle" onclick="return toggle('Helper.getTubeProperties');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getTubeProperties">getTubeProperties</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">coord1</tt><tt class="py-op">,</tt><tt class="py-param">coord2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getTubeProperties-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getTubeProperties-expanded"><a name="L424"></a><tt class="py-lineno"> 424</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L425"></a><tt class="py-lineno"> 425</tt>  <tt class="py-line"><tt class="py-docstring">        From two point return the length, and the orientation from one to another</tt> </tt>
<a name="L426"></a><tt class="py-lineno"> 426</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coord1: vector</tt> </tt>
<a name="L427"></a><tt class="py-lineno"> 427</tt>  <tt class="py-line"><tt class="py-docstring">        @param coord1: first point</tt> </tt>
<a name="L428"></a><tt class="py-lineno"> 428</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coord2: vector</tt> </tt>
<a name="L429"></a><tt class="py-lineno"> 429</tt>  <tt class="py-line"><tt class="py-docstring">        @param coord2: second point</tt> </tt>
<a name="L430"></a><tt class="py-lineno"> 430</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L431"></a><tt class="py-lineno"> 431</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   tupple</tt> </tt>
<a name="L432"></a><tt class="py-lineno"> 432</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  length, orientation, and intermediate point</tt> </tt>
<a name="L433"></a><tt class="py-lineno"> 433</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L434"></a><tt class="py-lineno"> 434</tt>  <tt class="py-line">        <tt class="py-name">x1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L435"></a><tt class="py-lineno"> 435</tt>  <tt class="py-line">        <tt class="py-name">y1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L436"></a><tt class="py-lineno"> 436</tt>  <tt class="py-line">        <tt class="py-name">z1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L437"></a><tt class="py-lineno"> 437</tt>  <tt class="py-line">        <tt class="py-name">x2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L438"></a><tt class="py-lineno"> 438</tt>  <tt class="py-line">        <tt class="py-name">y2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L439"></a><tt class="py-lineno"> 439</tt>  <tt class="py-line">        <tt class="py-name">z2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L440"></a><tt class="py-lineno"> 440</tt>  <tt class="py-line">        <tt class="py-name">laenge</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">x1</tt><tt class="py-op">-</tt><tt class="py-name">x2</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">x1</tt><tt class="py-op">-</tt><tt class="py-name">x2</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-name">y1</tt><tt class="py-op">-</tt><tt class="py-name">y2</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">y1</tt><tt class="py-op">-</tt><tt class="py-name">y2</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-name">z1</tt><tt class="py-op">-</tt><tt class="py-name">z2</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">z1</tt><tt class="py-op">-</tt><tt class="py-name">z2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L441"></a><tt class="py-lineno"> 441</tt>  <tt class="py-line">        <tt class="py-name">wsz</tt> <tt class="py-op">=</tt> <tt class="py-name">atan2</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">y1</tt><tt class="py-op">-</tt><tt class="py-name">y2</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">x1</tt><tt class="py-op">-</tt><tt class="py-name">x2</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L442"></a><tt class="py-lineno"> 442</tt>  <tt class="py-line">        <tt class="py-name">wz</tt> <tt class="py-op">=</tt> <tt class="py-name">acos</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">z1</tt><tt class="py-op">-</tt><tt class="py-name">z2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">laenge</tt><tt class="py-op">)</tt> </tt>
<a name="L443"></a><tt class="py-lineno"> 443</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">laenge</tt><tt class="py-op">,</tt><tt class="py-name">wsz</tt><tt class="py-op">,</tt><tt class="py-name">wz</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">x1</tt><tt class="py-op">+</tt><tt class="py-name">x2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">y1</tt><tt class="py-op">+</tt><tt class="py-name">y2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-name">z1</tt><tt class="py-op">+</tt><tt class="py-name">z2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
</div><a name="L444"></a><tt class="py-lineno"> 444</tt>  <tt class="py-line"> </tt>
<a name="Helper.getTubePropertiesMatrix"></a><div id="Helper.getTubePropertiesMatrix-def"><a name="L445"></a><tt class="py-lineno"> 445</tt> <a class="py-toggle" href="#" id="Helper.getTubePropertiesMatrix-toggle" onclick="return toggle('Helper.getTubePropertiesMatrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getTubePropertiesMatrix">getTubePropertiesMatrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">coord1</tt><tt class="py-op">,</tt><tt class="py-param">coord2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getTubePropertiesMatrix-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getTubePropertiesMatrix-expanded"><a name="L446"></a><tt class="py-lineno"> 446</tt>  <tt class="py-line">        <tt class="py-comment">#need ot overwrite in C4D</tt> </tt>
<a name="L447"></a><tt class="py-lineno"> 447</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#print coord1,coord1[0],type(coord1[0])</tt> </tt>
<a name="L448"></a><tt class="py-lineno"> 448</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">x1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L449"></a><tt class="py-lineno"> 449</tt>  <tt class="py-line">        <tt class="py-name">y1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L450"></a><tt class="py-lineno"> 450</tt>  <tt class="py-line">        <tt class="py-name">z1</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord1</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L451"></a><tt class="py-lineno"> 451</tt>  <tt class="py-line">        <tt class="py-name">x2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L452"></a><tt class="py-lineno"> 452</tt>  <tt class="py-line">        <tt class="py-name">y2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L453"></a><tt class="py-lineno"> 453</tt>  <tt class="py-line">        <tt class="py-name">z2</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L454"></a><tt class="py-lineno"> 454</tt>  <tt class="py-line"><tt class="py-comment">#        length = math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)+(z1-z2)*(z1-z2))</tt> </tt>
<a name="L455"></a><tt class="py-lineno"> 455</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        wsz = atan2((y1-y2), (z1-z2))</tt> </tt>
<a name="L456"></a><tt class="py-lineno"> 456</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        wz = acos((x1-x2)/laenge)</tt> </tt>
<a name="L457"></a><tt class="py-lineno"> 457</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        offset=numpy.array([float(x1+x2)/2,float(y1+y2)/2,float(z1+z2)/2])</tt> </tt>
<a name="L458"></a><tt class="py-lineno"> 458</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_2=numpy.array([float(x1-x2),float(y1-y2),float(z1-z2)])</tt> </tt>
<a name="L459"></a><tt class="py-lineno"> 459</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_2 = numpy.array(self.normalize(v_2))</tt> </tt>
<a name="L460"></a><tt class="py-lineno"> 460</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_1=numpy.array([float(0.),float(1.),float(2.)])</tt> </tt>
<a name="L461"></a><tt class="py-lineno"> 461</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_3=numpy.cross(v_1,v_2)</tt> </tt>
<a name="L462"></a><tt class="py-lineno"> 462</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_3 = numpy.array(self.normalize(v_3))</tt> </tt>
<a name="L463"></a><tt class="py-lineno"> 463</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_1=numpy.cross(v_2,v_3)</tt> </tt>
<a name="L464"></a><tt class="py-lineno"> 464</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        v_1 = numpy.array(self.normalize(v_1))</tt> </tt>
<a name="L465"></a><tt class="py-lineno"> 465</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M=numpy.identity(4)</tt> </tt>
<a name="L466"></a><tt class="py-lineno"> 466</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M[0,:3] = v_1</tt> </tt>
<a name="L467"></a><tt class="py-lineno"> 467</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M[1,:3] = v_2</tt> </tt>
<a name="L468"></a><tt class="py-lineno"> 468</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M[2,:3] = v_3</tt> </tt>
<a name="L469"></a><tt class="py-lineno"> 469</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M[3,:3] = offset</tt> </tt>
<a name="L470"></a><tt class="py-lineno"> 470</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        m = numpy.identity(4)</tt> </tt>
<a name="L471"></a><tt class="py-lineno"> 471</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        m[:3,:3] = M[:3,:3]</tt> </tt>
<a name="L472"></a><tt class="py-lineno"> 472</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        row_max = m.max(axis=1).reshape((-1, 1))</tt> </tt>
<a name="L473"></a><tt class="py-lineno"> 473</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        m = numpy.absolute((m / row_max))</tt> </tt>
<a name="L474"></a><tt class="py-lineno"> 474</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M[:3,:3] = m[:3,:3]</tt> </tt>
<a name="L475"></a><tt class="py-lineno"> 475</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">length</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-36" class="py-name" targets="Method upy.hostHelper.Helper.measure_distance()=upy.hostHelper.Helper-class.html#measure_distance"><a title="upy.hostHelper.Helper.measure_distance" class="py-name" href="#" onclick="return doclink('link-36', 'measure_distance', 'link-36');">measure_distance</a></tt><tt class="py-op">(</tt><tt class="py-name">coord2</tt><tt class="py-op">,</tt><tt class="py-name">coord1</tt><tt class="py-op">,</tt><tt class="py-name">vec</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L476"></a><tt class="py-lineno"> 476</tt>  <tt class="py-line">        <tt class="py-name">vx</tt><tt class="py-op">,</tt><tt class="py-name">vy</tt><tt class="py-op">,</tt><tt class="py-name">vz</tt> <tt class="py-op">=</tt> <tt class="py-name">v</tt> </tt>
<a name="L477"></a><tt class="py-lineno"> 477</tt>  <tt class="py-line">        <tt class="py-name">offset</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">x1</tt><tt class="py-op">+</tt><tt class="py-name">x2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">y1</tt><tt class="py-op">+</tt><tt class="py-name">y2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">z1</tt><tt class="py-op">+</tt><tt class="py-name">z2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt>       </tt>
<a name="L478"></a><tt class="py-lineno"> 478</tt>  <tt class="py-line">        <tt class="py-name">v_2</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-37" class="py-name"><a title="upy.hostHelper.Helper.unit_vector" class="py-name" href="#" onclick="return doclink('link-37', 'unit_vector', 'link-17');">unit_vector</a></tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L479"></a><tt class="py-lineno"> 479</tt>  <tt class="py-line">        <tt class="py-name">v_1</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-number">0.</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-number">1.</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-number">2.</tt><tt class="py-op">)</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L480"></a><tt class="py-lineno"> 480</tt>  <tt class="py-line">        <tt class="py-name">v_3</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">cross</tt><tt class="py-op">(</tt><tt class="py-name">v_1</tt><tt class="py-op">,</tt><tt class="py-name">v_2</tt><tt class="py-op">)</tt> </tt>
<a name="L481"></a><tt class="py-lineno"> 481</tt>  <tt class="py-line">        <tt class="py-name">v_3</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-38" class="py-name"><a title="upy.hostHelper.Helper.unit_vector" class="py-name" href="#" onclick="return doclink('link-38', 'unit_vector', 'link-17');">unit_vector</a></tt><tt class="py-op">(</tt><tt class="py-name">v_3</tt><tt class="py-op">,</tt><tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L482"></a><tt class="py-lineno"> 482</tt>  <tt class="py-line">        <tt class="py-name">v_1</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">cross</tt><tt class="py-op">(</tt><tt class="py-name">v_2</tt><tt class="py-op">,</tt><tt class="py-name">v_3</tt><tt class="py-op">)</tt> </tt>
<a name="L483"></a><tt class="py-lineno"> 483</tt>  <tt class="py-line">        <tt class="py-name">v_1</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-39" class="py-name"><a title="upy.hostHelper.Helper.unit_vector" class="py-name" href="#" onclick="return doclink('link-39', 'unit_vector', 'link-17');">unit_vector</a></tt><tt class="py-op">(</tt><tt class="py-name">v_1</tt><tt class="py-op">,</tt><tt class="py-name">axis</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L484"></a><tt class="py-lineno"> 484</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">identity</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
<a name="L485"></a><tt class="py-lineno"> 485</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v_1</tt> </tt>
<a name="L486"></a><tt class="py-lineno"> 486</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v_2</tt> </tt>
<a name="L487"></a><tt class="py-lineno"> 487</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">v_3</tt> </tt>
<a name="L488"></a><tt class="py-lineno"> 488</tt>  <tt class="py-line">        <tt class="py-name">M</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">offset</tt>         </tt>
<a name="L489"></a><tt class="py-lineno"> 489</tt>  <tt class="py-line"><tt class="py-comment">#        sx = 1</tt> </tt>
<a name="L490"></a><tt class="py-lineno"> 490</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        nx = 0</tt> </tt>
<a name="L491"></a><tt class="py-lineno"> 491</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        ny = 1</tt> </tt>
<a name="L492"></a><tt class="py-lineno"> 492</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        #this is probably dependant on the princpal axis of the cylinder</tt> </tt>
<a name="L493"></a><tt class="py-lineno"> 493</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        if (vx != 0 or vy != 0):</tt> </tt>
<a name="L494"></a><tt class="py-lineno"> 494</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            alpha = (1. - vz) / (vx*vx + vy*vy)</tt> </tt>
<a name="L495"></a><tt class="py-lineno"> 495</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            sx = -vy*vy*alpha - vz</tt> </tt>
<a name="L496"></a><tt class="py-lineno"> 496</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            nx = alpha*vx*vy</tt> </tt>
<a name="L497"></a><tt class="py-lineno"> 497</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            ny = -vx*vx*alpha - vz</tt> </tt>
<a name="L498"></a><tt class="py-lineno"> 498</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#        M = [[sx, nx, vx,offset[0]],</tt> </tt>
<a name="L499"></a><tt class="py-lineno"> 499</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            [nx, ny, vy,offset[1]],</tt> </tt>
<a name="L500"></a><tt class="py-lineno"> 500</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            [vx, vy, vz,offset[2]],</tt> </tt>
<a name="L501"></a><tt class="py-lineno"> 501</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            [0.,0.,0.,1.],]</tt> </tt>
<a name="L502"></a><tt class="py-lineno"> 502</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">length</tt><tt class="py-op">,</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">M</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">transpose</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L503"></a><tt class="py-lineno"> 503</tt>  <tt class="py-line"> </tt>
<a name="Helper.getCenter"></a><div id="Helper.getCenter-def"><a name="L504"></a><tt class="py-lineno"> 504</tt> <a class="py-toggle" href="#" id="Helper.getCenter-toggle" onclick="return toggle('Helper.getCenter');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getCenter">getCenter</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">coords</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getCenter-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getCenter-expanded"><a name="L505"></a><tt class="py-lineno"> 505</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L506"></a><tt class="py-lineno"> 506</tt>  <tt class="py-line"><tt class="py-docstring">        Get the center from a 3d array of coordinate x,y,z.</tt> </tt>
<a name="L507"></a><tt class="py-lineno"> 507</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L508"></a><tt class="py-lineno"> 508</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array</tt> </tt>
<a name="L509"></a><tt class="py-lineno"> 509</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: the coordinates</tt> </tt>
<a name="L510"></a><tt class="py-lineno"> 510</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L511"></a><tt class="py-lineno"> 511</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list/array</tt> </tt>
<a name="L512"></a><tt class="py-lineno"> 512</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the center of mass of the coordinates</tt> </tt>
<a name="L513"></a><tt class="py-lineno"> 513</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L514"></a><tt class="py-lineno"> 514</tt>  <tt class="py-line">        <tt class="py-keyword">import</tt> <tt class="py-name">numpy</tt> </tt>
<a name="L515"></a><tt class="py-lineno"> 515</tt>  <tt class="py-line"><tt class="py-comment">#        if len(coords) == 3 :</tt> </tt>
<a name="L516"></a><tt class="py-lineno"> 516</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#            if type(coords[0]) is int or type(coords[0]) is float :</tt> </tt>
<a name="L517"></a><tt class="py-lineno"> 517</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#                coords = [coords,]      </tt> </tt>
<a name="L518"></a><tt class="py-lineno"> 518</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">coords</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt><tt class="py-comment">#self.allAtoms.coords</tt> </tt>
<a name="L519"></a><tt class="py-lineno"> 519</tt>  <tt class="py-line">        <tt class="py-name">center</tt> <tt class="py-op">=</tt> <tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">coords</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-number">1.0</tt><tt class="py-op">)</tt> </tt>
<a name="L520"></a><tt class="py-lineno"> 520</tt>  <tt class="py-line">        <tt class="py-name">center</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">center</tt><tt class="py-op">)</tt> </tt>
<a name="L521"></a><tt class="py-lineno"> 521</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L522"></a><tt class="py-lineno"> 522</tt>  <tt class="py-line">            <tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">round</tt><tt class="py-op">(</tt><tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
<a name="L523"></a><tt class="py-lineno"> 523</tt>  <tt class="py-line"><tt class="py-comment">#        print "center =", center</tt> </tt>
<a name="L524"></a><tt class="py-lineno"> 524</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">center</tt> </tt>
</div><a name="L525"></a><tt class="py-lineno"> 525</tt>  <tt class="py-line"> </tt>
<a name="Helper.update"></a><div id="Helper.update-def"><a name="L526"></a><tt class="py-lineno"> 526</tt> <a class="py-toggle" href="#" id="Helper.update-toggle" onclick="return toggle('Helper.update');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#update">update</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.update-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.update-expanded"><a name="L527"></a><tt class="py-lineno"> 527</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L528"></a><tt class="py-lineno"> 528</tt>  <tt class="py-line"><tt class="py-docstring">        Update the host viewport, ui or gl draw</tt> </tt>
<a name="L529"></a><tt class="py-lineno"> 529</tt>  <tt class="py-line"><tt class="py-docstring">        This function can't be call in a thread.</tt> </tt>
<a name="L530"></a><tt class="py-lineno"> 530</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L531"></a><tt class="py-lineno"> 531</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="Helper.fit_view3D"></a><div id="Helper.fit_view3D-def"><a name="L532"></a><tt class="py-lineno"> 532</tt> <a class="py-toggle" href="#" id="Helper.fit_view3D-toggle" onclick="return toggle('Helper.fit_view3D');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#fit_view3D">fit_view3D</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.fit_view3D-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.fit_view3D-expanded"><a name="L533"></a><tt class="py-lineno"> 533</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L534"></a><tt class="py-lineno"> 534</tt>  <tt class="py-line"><tt class="py-docstring">        Function that should recenter the viewport to the object in the scene</tt> </tt>
<a name="L535"></a><tt class="py-lineno"> 535</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L536"></a><tt class="py-lineno"> 536</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L537"></a><tt class="py-lineno"> 537</tt>  <tt class="py-line"><tt class="py-comment">#        c4d.CallCommand(self.FITTOVIEW)</tt> </tt>
<a name="L538"></a><tt class="py-lineno"> 538</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="Helper.checkName"></a><div id="Helper.checkName-def"><a name="L539"></a><tt class="py-lineno"> 539</tt> <a class="py-toggle" href="#" id="Helper.checkName-toggle" onclick="return toggle('Helper.checkName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#checkName">checkName</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.checkName-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.checkName-expanded"><a name="L540"></a><tt class="py-lineno"> 540</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L541"></a><tt class="py-lineno"> 541</tt>  <tt class="py-line"><tt class="py-docstring">        Check the name of the molecule/filename to avoid invalid caracter for the </tt> </tt>
<a name="L542"></a><tt class="py-lineno"> 542</tt>  <tt class="py-line"><tt class="py-docstring">        host. ie maya didnt support object name starting with number. If a invalid </tt> </tt>
<a name="L543"></a><tt class="py-lineno"> 543</tt>  <tt class="py-line"><tt class="py-docstring">        caracter is found, the caracter is removed.</tt> </tt>
<a name="L544"></a><tt class="py-lineno"> 544</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L545"></a><tt class="py-lineno"> 545</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L546"></a><tt class="py-lineno"> 546</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the molecule.</tt> </tt>
<a name="L547"></a><tt class="py-lineno"> 547</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   string</tt> </tt>
<a name="L548"></a><tt class="py-lineno"> 548</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  corrected name of the molecule.</tt> </tt>
<a name="L549"></a><tt class="py-lineno"> 549</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L550"></a><tt class="py-lineno"> 550</tt>  <tt class="py-line">        <tt class="py-name">invalid</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt>  </tt>
<a name="L551"></a><tt class="py-lineno"> 551</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">9</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L552"></a><tt class="py-lineno"> 552</tt>  <tt class="py-line">            <tt class="py-name">invalid</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">)</tt>        </tt>
<a name="L553"></a><tt class="py-lineno"> 553</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">name</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">in</tt> <tt class="py-name">invalid</tt><tt class="py-op">:</tt> </tt>
<a name="L554"></a><tt class="py-lineno"> 554</tt>  <tt class="py-line">            <tt class="py-name">name</tt><tt class="py-op">=</tt> <tt class="py-name">name</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt>     </tt>
<a name="L555"></a><tt class="py-lineno"> 555</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">name</tt>    </tt>
</div><a name="L556"></a><tt class="py-lineno"> 556</tt>  <tt class="py-line">         </tt>
<a name="Helper.getObject"></a><div id="Helper.getObject-def"><a name="L557"></a><tt class="py-lineno"> 557</tt> <a class="py-toggle" href="#" id="Helper.getObject-toggle" onclick="return toggle('Helper.getObject');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getObject">getObject</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getObject-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getObject-expanded"><a name="L558"></a><tt class="py-lineno"> 558</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L559"></a><tt class="py-lineno"> 559</tt>  <tt class="py-line"><tt class="py-docstring">        retrieve an object from his name. </tt> </tt>
<a name="L560"></a><tt class="py-lineno"> 560</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L561"></a><tt class="py-lineno"> 561</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L562"></a><tt class="py-lineno"> 562</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: request name of an host object</tt> </tt>
<a name="L563"></a><tt class="py-lineno"> 563</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L564"></a><tt class="py-lineno"> 564</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L565"></a><tt class="py-lineno"> 565</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the object with the requested name or None</tt> </tt>
<a name="L566"></a><tt class="py-lineno"> 566</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L567"></a><tt class="py-lineno"> 567</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L568"></a><tt class="py-lineno"> 568</tt>  <tt class="py-line"> </tt>
<a name="Helper.getObjectName"></a><div id="Helper.getObjectName-def"><a name="L569"></a><tt class="py-lineno"> 569</tt> <a class="py-toggle" href="#" id="Helper.getObjectName-toggle" onclick="return toggle('Helper.getObjectName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getObjectName">getObjectName</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">o</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getObjectName-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getObjectName-expanded"><a name="L570"></a><tt class="py-lineno"> 570</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L571"></a><tt class="py-lineno"> 571</tt>  <tt class="py-line"><tt class="py-docstring">        Return the name of an host object</tt> </tt>
<a name="L572"></a><tt class="py-lineno"> 572</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L573"></a><tt class="py-lineno"> 573</tt>  <tt class="py-line"><tt class="py-docstring">        @type  o: hostObject</tt> </tt>
<a name="L574"></a><tt class="py-lineno"> 574</tt>  <tt class="py-line"><tt class="py-docstring">        @param o: an host object</tt> </tt>
<a name="L575"></a><tt class="py-lineno"> 575</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   string</tt> </tt>
<a name="L576"></a><tt class="py-lineno"> 576</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the name of the host object</tt> </tt>
<a name="L577"></a><tt class="py-lineno"> 577</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L578"></a><tt class="py-lineno"> 578</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L579"></a><tt class="py-lineno"> 579</tt>  <tt class="py-line"> </tt>
<a name="Helper.getCurrentScene"></a><div id="Helper.getCurrentScene-def"><a name="L580"></a><tt class="py-lineno"> 580</tt> <a class="py-toggle" href="#" id="Helper.getCurrentScene-toggle" onclick="return toggle('Helper.getCurrentScene');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getCurrentScene">getCurrentScene</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getCurrentScene-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getCurrentScene-expanded"><a name="L581"></a><tt class="py-lineno"> 581</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L582"></a><tt class="py-lineno"> 582</tt>  <tt class="py-line"><tt class="py-docstring">        Return the current/active working document or scene</tt> </tt>
<a name="L583"></a><tt class="py-lineno"> 583</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L584"></a><tt class="py-lineno"> 584</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   scene</tt> </tt>
<a name="L585"></a><tt class="py-lineno"> 585</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the active scene</tt> </tt>
<a name="L586"></a><tt class="py-lineno"> 586</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L587"></a><tt class="py-lineno"> 587</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L588"></a><tt class="py-lineno"> 588</tt>  <tt class="py-line"> </tt>
<a name="Helper.getCurrentSelection"></a><div id="Helper.getCurrentSelection-def"><a name="L589"></a><tt class="py-lineno"> 589</tt> <a class="py-toggle" href="#" id="Helper.getCurrentSelection-toggle" onclick="return toggle('Helper.getCurrentSelection');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getCurrentSelection">getCurrentSelection</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getCurrentSelection-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getCurrentSelection-expanded"><a name="L590"></a><tt class="py-lineno"> 590</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L591"></a><tt class="py-lineno"> 591</tt>  <tt class="py-line"><tt class="py-docstring">        Return the current/active selected object in the document or scene</tt> </tt>
<a name="L592"></a><tt class="py-lineno"> 592</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L593"></a><tt class="py-lineno"> 593</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   liste</tt> </tt>
<a name="L594"></a><tt class="py-lineno"> 594</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the list of selected object</tt> </tt>
<a name="L595"></a><tt class="py-lineno"> 595</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L596"></a><tt class="py-lineno"> 596</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L597"></a><tt class="py-lineno"> 597</tt>  <tt class="py-line"> </tt>
<a name="Helper.getPosUntilRoot"></a><div id="Helper.getPosUntilRoot-def"><a name="L598"></a><tt class="py-lineno"> 598</tt> <a class="py-toggle" href="#" id="Helper.getPosUntilRoot-toggle" onclick="return toggle('Helper.getPosUntilRoot');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getPosUntilRoot">getPosUntilRoot</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getPosUntilRoot-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getPosUntilRoot-expanded"><a name="L599"></a><tt class="py-lineno"> 599</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L600"></a><tt class="py-lineno"> 600</tt>  <tt class="py-line"><tt class="py-docstring">        Go through the hierarchy of the object until reaching the top level, </tt> </tt>
<a name="L601"></a><tt class="py-lineno"> 601</tt>  <tt class="py-line"><tt class="py-docstring">        increment the position to get the transformation due to parents. </tt> </tt>
<a name="L602"></a><tt class="py-lineno"> 602</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L603"></a><tt class="py-lineno"> 603</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L604"></a><tt class="py-lineno"> 604</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object   </tt> </tt>
<a name="L605"></a><tt class="py-lineno"> 605</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L606"></a><tt class="py-lineno"> 606</tt>  <tt class="py-line"><tt class="py-docstring">       </tt> </tt>
<a name="L607"></a><tt class="py-lineno"> 607</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list</tt> </tt>
<a name="L608"></a><tt class="py-lineno"> 608</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the cumulative translation along the parenting hierarchy   </tt> </tt>
<a name="L609"></a><tt class="py-lineno"> 609</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L610"></a><tt class="py-lineno"> 610</tt>  <tt class="py-line">         </tt>
<a name="L611"></a><tt class="py-lineno"> 611</tt>  <tt class="py-line">        <tt class="py-name">stop</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L612"></a><tt class="py-lineno"> 612</tt>  <tt class="py-line">        <tt class="py-comment">#get the first parent</tt> </tt>
<a name="L613"></a><tt class="py-lineno"> 613</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">pos</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L614"></a><tt class="py-lineno"> 614</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-keyword">not</tt> <tt class="py-name">stop</tt> <tt class="py-op">:</tt> </tt>
<a name="L615"></a><tt class="py-lineno"> 615</tt>  <tt class="py-line">            <tt class="py-comment">#get the parent position, and add it to pos</tt> </tt>
<a name="L616"></a><tt class="py-lineno"> 616</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#get the parent of the previous parent</tt> </tt>
<a name="L617"></a><tt class="py-lineno"> 617</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">parent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L618"></a><tt class="py-lineno"> 618</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">parent</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L619"></a><tt class="py-lineno"> 619</tt>  <tt class="py-line">                <tt class="py-name">stop</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L620"></a><tt class="py-lineno"> 620</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">pos</tt>         </tt>
</div><a name="L621"></a><tt class="py-lineno"> 621</tt>  <tt class="py-line">         </tt>
<a name="Helper.addObjectToScene"></a><div id="Helper.addObjectToScene-def"><a name="L622"></a><tt class="py-lineno"> 622</tt> <a class="py-toggle" href="#" id="Helper.addObjectToScene-toggle" onclick="return toggle('Helper.addObjectToScene');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addObjectToScene">addObjectToScene</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">doc</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">parent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">centerRoot</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-param">rePos</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addObjectToScene-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addObjectToScene-expanded"><a name="L623"></a><tt class="py-lineno"> 623</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L624"></a><tt class="py-lineno"> 624</tt>  <tt class="py-line"><tt class="py-docstring">        Insert/add an object to the current document under the specified parent, and</tt> </tt>
<a name="L625"></a><tt class="py-lineno"> 625</tt>  <tt class="py-line"><tt class="py-docstring">        at the specified location</tt> </tt>
<a name="L626"></a><tt class="py-lineno"> 626</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L627"></a><tt class="py-lineno"> 627</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L628"></a><tt class="py-lineno"> 628</tt>  <tt class="py-line"><tt class="py-docstring">        @type  doc: hostScene</tt> </tt>
<a name="L629"></a><tt class="py-lineno"> 629</tt>  <tt class="py-line"><tt class="py-docstring">        @param doc: the scene where to insert the object   </tt> </tt>
<a name="L630"></a><tt class="py-lineno"> 630</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L631"></a><tt class="py-lineno"> 631</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object to insert</tt> </tt>
<a name="L632"></a><tt class="py-lineno"> 632</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parent: hostObject</tt> </tt>
<a name="L633"></a><tt class="py-lineno"> 633</tt>  <tt class="py-line"><tt class="py-docstring">        @param parent: the parent of the object to insert under  </tt> </tt>
<a name="L634"></a><tt class="py-lineno"> 634</tt>  <tt class="py-line"><tt class="py-docstring">        @type  centerRoot: boolean</tt> </tt>
<a name="L635"></a><tt class="py-lineno"> 635</tt>  <tt class="py-line"><tt class="py-docstring">        @param centerRoot: if the object have to be recentered according the top-level  </tt> </tt>
<a name="L636"></a><tt class="py-lineno"> 636</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rePos: list</tt> </tt>
<a name="L637"></a><tt class="py-lineno"> 637</tt>  <tt class="py-line"><tt class="py-docstring">        @param rePos: the location of the object in the scene </tt> </tt>
<a name="L638"></a><tt class="py-lineno"> 638</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L639"></a><tt class="py-lineno"> 639</tt>  <tt class="py-line">        <tt class="py-comment">#get the object name</tt> </tt>
<a name="L640"></a><tt class="py-lineno"> 640</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">name</tt><tt class="py-op">=</tt><tt class="py-string">""</tt> </tt>
<a name="L641"></a><tt class="py-lineno"> 641</tt>  <tt class="py-line">        <tt class="py-comment">#if the object is not already in the scene</tt> </tt>
<a name="L642"></a><tt class="py-lineno"> 642</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-40" class="py-name" targets="Method upy.hostHelper.Helper.getObject()=upy.hostHelper.Helper-class.html#getObject"><a title="upy.hostHelper.Helper.getObject" class="py-name" href="#" onclick="return doclink('link-40', 'getObject', 'link-40');">getObject</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L643"></a><tt class="py-lineno"> 643</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">parent</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt>  </tt>
<a name="L644"></a><tt class="py-lineno"> 644</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">parent</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-name">str</tt> <tt class="py-op">:</tt> <tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-41" class="py-name"><a title="upy.hostHelper.Helper.getObject" class="py-name" href="#" onclick="return doclink('link-41', 'getObject', 'link-40');">getObject</a></tt><tt class="py-op">(</tt><tt class="py-name">parent</tt><tt class="py-op">)</tt> </tt>
<a name="L645"></a><tt class="py-lineno"> 645</tt>  <tt class="py-line">                <tt class="py-comment">#if parent exist, insert the object under it</tt> </tt>
<a name="L646"></a><tt class="py-lineno"> 646</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-keyword">pass</tt> </tt>
<a name="L647"></a><tt class="py-lineno"> 647</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">centerRoot</tt> <tt class="py-op">:</tt> </tt>
<a name="L648"></a><tt class="py-lineno"> 648</tt>  <tt class="py-line">                    <tt class="py-comment">#get the current position of the object</tt> </tt>
<a name="L649"></a><tt class="py-lineno"> 649</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-name">currentPos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L650"></a><tt class="py-lineno"> 650</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-name">rePos</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt>  </tt>
<a name="L651"></a><tt class="py-lineno"> 651</tt>  <tt class="py-line">                        <tt class="py-name">parentPos</tt> <tt class="py-op">=</tt> <tt class="py-name">rePos</tt>           </tt>
<a name="L652"></a><tt class="py-lineno"> 652</tt>  <tt class="py-line">                    <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L653"></a><tt class="py-lineno"> 653</tt>  <tt class="py-line">                        <tt class="py-name">parentPos</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-42" class="py-name" targets="Method upy.hostHelper.Helper.getPosUntilRoot()=upy.hostHelper.Helper-class.html#getPosUntilRoot"><a title="upy.hostHelper.Helper.getPosUntilRoot" class="py-name" href="#" onclick="return doclink('link-42', 'getPosUntilRoot', 'link-42');">getPosUntilRoot</a></tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">)</tt><tt class="py-comment">#parent.GetPos()</tt> </tt>
<a name="L654"></a><tt class="py-lineno"> 654</tt>  <tt class="py-line">                    <tt class="py-comment">#set the new position of the object</tt> </tt>
<a name="L655"></a><tt class="py-lineno"> 655</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-keyword">pass</tt> </tt>
<a name="L656"></a><tt class="py-lineno"> 656</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt>     </tt>
<a name="L657"></a><tt class="py-lineno"> 657</tt>  <tt class="py-line">                <tt class="py-comment">#insert the object</tt> </tt>
<a name="L658"></a><tt class="py-lineno"> 658</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-keyword">pass</tt> </tt>
</div><a name="L659"></a><tt class="py-lineno"> 659</tt>  <tt class="py-line">     </tt>
<a name="L660"></a><tt class="py-lineno"> 660</tt>  <tt class="py-line">     </tt>
<a name="Helper.AddObject"></a><div id="Helper.AddObject-def"><a name="L661"></a><tt class="py-lineno"> 661</tt> <a class="py-toggle" href="#" id="Helper.AddObject-toggle" onclick="return toggle('Helper.AddObject');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#AddObject">AddObject</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">parent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">centerRoot</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-param">rePos</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.AddObject-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.AddObject-expanded"><a name="L662"></a><tt class="py-lineno"> 662</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L663"></a><tt class="py-lineno"> 663</tt>  <tt class="py-line"><tt class="py-docstring">        Insert/add an object to the current document under the specified parent, and</tt> </tt>
<a name="L664"></a><tt class="py-lineno"> 664</tt>  <tt class="py-line"><tt class="py-docstring">        at the specified location. This function is an alias for addObjectToScene to</tt> </tt>
<a name="L665"></a><tt class="py-lineno"> 665</tt>  <tt class="py-line"><tt class="py-docstring">        permit to some script to work either in dejavu and the host</tt> </tt>
<a name="L666"></a><tt class="py-lineno"> 666</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L667"></a><tt class="py-lineno"> 667</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L668"></a><tt class="py-lineno"> 668</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object to insert</tt> </tt>
<a name="L669"></a><tt class="py-lineno"> 669</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parent: hostObject</tt> </tt>
<a name="L670"></a><tt class="py-lineno"> 670</tt>  <tt class="py-line"><tt class="py-docstring">        @param parent: the parent of the object to insert under  </tt> </tt>
<a name="L671"></a><tt class="py-lineno"> 671</tt>  <tt class="py-line"><tt class="py-docstring">        @type  centerRoot: boolean</tt> </tt>
<a name="L672"></a><tt class="py-lineno"> 672</tt>  <tt class="py-line"><tt class="py-docstring">        @param centerRoot: if the object have to be recentered according the top-level  </tt> </tt>
<a name="L673"></a><tt class="py-lineno"> 673</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rePos: list</tt> </tt>
<a name="L674"></a><tt class="py-lineno"> 674</tt>  <tt class="py-line"><tt class="py-docstring">        @param rePos: the location of the object in the scene </tt> </tt>
<a name="L675"></a><tt class="py-lineno"> 675</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L676"></a><tt class="py-lineno"> 676</tt>  <tt class="py-line">     </tt>
<a name="L677"></a><tt class="py-lineno"> 677</tt>  <tt class="py-line">        <tt class="py-name">doc</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-43" class="py-name" targets="Method upy.hostHelper.Helper.getCurrentScene()=upy.hostHelper.Helper-class.html#getCurrentScene"><a title="upy.hostHelper.Helper.getCurrentScene" class="py-name" href="#" onclick="return doclink('link-43', 'getCurrentScene', 'link-43');">getCurrentScene</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L678"></a><tt class="py-lineno"> 678</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-44" class="py-name" targets="Method upy.hostHelper.Helper.addObjectToScene()=upy.hostHelper.Helper-class.html#addObjectToScene"><a title="upy.hostHelper.Helper.addObjectToScene" class="py-name" href="#" onclick="return doclink('link-44', 'addObjectToScene', 'link-44');">addObjectToScene</a></tt><tt class="py-op">(</tt><tt class="py-name">doc</tt><tt class="py-op">,</tt><tt class="py-name">object</tt><tt class="py-op">,</tt><tt class="py-name">parent</tt><tt class="py-op">=</tt><tt class="py-name">parent</tt><tt class="py-op">,</tt><tt class="py-name">centerRoot</tt><tt class="py-op">=</tt><tt class="py-name">centerRoot</tt><tt class="py-op">,</tt> </tt>
<a name="L679"></a><tt class="py-lineno"> 679</tt>  <tt class="py-line">                              <tt class="py-name">rePos</tt><tt class="py-op">=</tt><tt class="py-name">rePos</tt><tt class="py-op">)</tt> </tt>
</div><a name="L680"></a><tt class="py-lineno"> 680</tt>  <tt class="py-line"> </tt>
<a name="Helper.ObjectsSelection"></a><div id="Helper.ObjectsSelection-def"><a name="L681"></a><tt class="py-lineno"> 681</tt> <a class="py-toggle" href="#" id="Helper.ObjectsSelection-toggle" onclick="return toggle('Helper.ObjectsSelection');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#ObjectsSelection">ObjectsSelection</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">listeObjects</tt><tt class="py-op">,</tt><tt class="py-param">typeSel</tt><tt class="py-op">=</tt><tt class="py-string">"new"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.ObjectsSelection-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.ObjectsSelection-expanded"><a name="L682"></a><tt class="py-lineno"> 682</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L683"></a><tt class="py-lineno"> 683</tt>  <tt class="py-line"><tt class="py-docstring">        Modify the current object selection.</tt> </tt>
<a name="L684"></a><tt class="py-lineno"> 684</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L685"></a><tt class="py-lineno"> 685</tt>  <tt class="py-line"><tt class="py-docstring">        @type  listeObjects: list</tt> </tt>
<a name="L686"></a><tt class="py-lineno"> 686</tt>  <tt class="py-line"><tt class="py-docstring">        @param listeObjects: list of object to joins</tt> </tt>
<a name="L687"></a><tt class="py-lineno"> 687</tt>  <tt class="py-line"><tt class="py-docstring">        @type  typeSel: string</tt> </tt>
<a name="L688"></a><tt class="py-lineno"> 688</tt>  <tt class="py-line"><tt class="py-docstring">        @param listeObjects: type of modification: new,add,...</tt> </tt>
<a name="L689"></a><tt class="py-lineno"> 689</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L690"></a><tt class="py-lineno"> 690</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L691"></a><tt class="py-lineno"> 691</tt>  <tt class="py-line"><tt class="py-comment">#        dic={"add":c4d.SELECTION_ADD,"new":c4d.SELECTION_NEW}</tt> </tt>
<a name="L692"></a><tt class="py-lineno"> 692</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">sc</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-45" class="py-name"><a title="upy.hostHelper.Helper.getCurrentScene" class="py-name" href="#" onclick="return doclink('link-45', 'getCurrentScene', 'link-43');">getCurrentScene</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L693"></a><tt class="py-lineno"> 693</tt>  <tt class="py-line">        <tt class="py-comment">#Put here the code to add/set an object to the current slection</tt> </tt>
<a name="L694"></a><tt class="py-lineno"> 694</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#[sc.SetSelection(x,dic[typeSel]) for x in listeObjects]</tt> </tt>
<a name="L695"></a><tt class="py-lineno"> 695</tt>  <tt class="py-line"><tt class="py-comment"></tt>     </tt>
<a name="Helper.JoinsObjects"></a><div id="Helper.JoinsObjects-def"><a name="L696"></a><tt class="py-lineno"> 696</tt> <a class="py-toggle" href="#" id="Helper.JoinsObjects-toggle" onclick="return toggle('Helper.JoinsObjects');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#JoinsObjects">JoinsObjects</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">listeObjects</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.JoinsObjects-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.JoinsObjects-expanded"><a name="L697"></a><tt class="py-lineno"> 697</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L698"></a><tt class="py-lineno"> 698</tt>  <tt class="py-line"><tt class="py-docstring">        Merge the given liste of object in one unique geometry.</tt> </tt>
<a name="L699"></a><tt class="py-lineno"> 699</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L700"></a><tt class="py-lineno"> 700</tt>  <tt class="py-line"><tt class="py-docstring">        @type  listeObjects: list</tt> </tt>
<a name="L701"></a><tt class="py-lineno"> 701</tt>  <tt class="py-line"><tt class="py-docstring">        @param listeObjects: list of object to joins</tt> </tt>
<a name="L702"></a><tt class="py-lineno"> 702</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L703"></a><tt class="py-lineno"> 703</tt>  <tt class="py-line">        <tt class="py-name">sc</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-46" class="py-name"><a title="upy.hostHelper.Helper.getCurrentScene" class="py-name" href="#" onclick="return doclink('link-46', 'getCurrentScene', 'link-43');">getCurrentScene</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L704"></a><tt class="py-lineno"> 704</tt>  <tt class="py-line">        <tt class="py-comment">#put here the code to add the liste of object to the selection</tt> </tt>
<a name="L705"></a><tt class="py-lineno"> 705</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    sc.SetSelection(listeObjects[0],c4d.SELECTION_NEW)</tt> </tt>
<a name="L706"></a><tt class="py-lineno"> 706</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    for i in range(1,len(listeObjects)):</tt> </tt>
<a name="L707"></a><tt class="py-lineno"> 707</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#        sc.SetSelection(listeObjects[i],c4d.SELECTION_ADD)</tt> </tt>
<a name="L708"></a><tt class="py-lineno"> 708</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#then call the command/function that joins the object selected</tt> </tt>
<a name="L709"></a><tt class="py-lineno"> 709</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    c4d.CallCommand(CONNECT)</tt> </tt>
<a name="L710"></a><tt class="py-lineno"> 710</tt>  <tt class="py-line"><tt class="py-comment"></tt>         </tt>
<a name="L711"></a><tt class="py-lineno"> 711</tt>  <tt class="py-line">     </tt>
<a name="L712"></a><tt class="py-lineno"> 712</tt>  <tt class="py-line">     </tt>
<a name="Helper.addCameraToScene"></a><div id="Helper.addCameraToScene-def"><a name="L713"></a><tt class="py-lineno"> 713</tt> <a class="py-toggle" href="#" id="Helper.addCameraToScene-toggle" onclick="return toggle('Helper.addCameraToScene');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addCameraToScene">addCameraToScene</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">Type</tt><tt class="py-op">,</tt><tt class="py-param">focal</tt><tt class="py-op">,</tt><tt class="py-param">center</tt><tt class="py-op">,</tt><tt class="py-param">scene</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addCameraToScene-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addCameraToScene-expanded"><a name="L714"></a><tt class="py-lineno"> 714</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L715"></a><tt class="py-lineno"> 715</tt>  <tt class="py-line"><tt class="py-docstring">        Add a camera object to the scene</tt> </tt>
<a name="L716"></a><tt class="py-lineno"> 716</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L717"></a><tt class="py-lineno"> 717</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L718"></a><tt class="py-lineno"> 718</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the camera</tt> </tt>
<a name="L719"></a><tt class="py-lineno"> 719</tt>  <tt class="py-line"><tt class="py-docstring">        @type  Type: cameraType</tt> </tt>
<a name="L720"></a><tt class="py-lineno"> 720</tt>  <tt class="py-line"><tt class="py-docstring">        @param Type: perspective, orthogonale etc...</tt> </tt>
<a name="L721"></a><tt class="py-lineno"> 721</tt>  <tt class="py-line"><tt class="py-docstring">        @type  focal: float</tt> </tt>
<a name="L722"></a><tt class="py-lineno"> 722</tt>  <tt class="py-line"><tt class="py-docstring">        @param focal: the focal of the camera</tt> </tt>
<a name="L723"></a><tt class="py-lineno"> 723</tt>  <tt class="py-line"><tt class="py-docstring">        @type  center: list</tt> </tt>
<a name="L724"></a><tt class="py-lineno"> 724</tt>  <tt class="py-line"><tt class="py-docstring">        @param center: the position of the camera</tt> </tt>
<a name="L725"></a><tt class="py-lineno"> 725</tt>  <tt class="py-line"><tt class="py-docstring">        @type  scene: host scene</tt> </tt>
<a name="L726"></a><tt class="py-lineno"> 726</tt>  <tt class="py-line"><tt class="py-docstring">        @param scene: the scene</tt> </tt>
<a name="L727"></a><tt class="py-lineno"> 727</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L728"></a><tt class="py-lineno"> 728</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L729"></a><tt class="py-lineno"> 729</tt>  <tt class="py-line">          </tt>
<a name="L730"></a><tt class="py-lineno"> 730</tt>  <tt class="py-line">        <tt class="py-name">cam</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L731"></a><tt class="py-lineno"> 731</tt>  <tt class="py-line">        <tt class="py-comment">#cam.SetPos(center)</tt> </tt>
<a name="L732"></a><tt class="py-lineno"> 732</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#cam perspective or parrallel</tt> </tt>
<a name="L733"></a><tt class="py-lineno"> 733</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#cam focal = float(focal)  #</tt> </tt>
<a name="L734"></a><tt class="py-lineno"> 734</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#most of the time we apply a rotation to get the same result as in PMV</tt> </tt>
<a name="L735"></a><tt class="py-lineno"> 735</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#cam rotZ = pi/2.</tt> </tt>
<a name="L736"></a><tt class="py-lineno"> 736</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-47" class="py-name"><a title="upy.hostHelper.Helper.addObjectToScene" class="py-name" href="#" onclick="return doclink('link-47', 'addObjectToScene', 'link-44');">addObjectToScene</a></tt><tt class="py-op">(</tt><tt class="py-name">scene</tt><tt class="py-op">,</tt><tt class="py-name">cam</tt><tt class="py-op">,</tt><tt class="py-name">centerRoot</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt>     </tt>
</div><a name="L737"></a><tt class="py-lineno"> 737</tt>  <tt class="py-line">     </tt>
<a name="Helper.addLampToScene"></a><div id="Helper.addLampToScene-def"><a name="L738"></a><tt class="py-lineno"> 738</tt> <a class="py-toggle" href="#" id="Helper.addLampToScene-toggle" onclick="return toggle('Helper.addLampToScene');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addLampToScene">addLampToScene</a><tt class="py-op">(</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">Type</tt><tt class="py-op">,</tt><tt class="py-param">rgb</tt><tt class="py-op">,</tt><tt class="py-param">dist</tt><tt class="py-op">,</tt><tt class="py-param">energy</tt><tt class="py-op">,</tt><tt class="py-param">soft</tt><tt class="py-op">,</tt><tt class="py-param">shadow</tt><tt class="py-op">,</tt><tt class="py-param">center</tt><tt class="py-op">,</tt><tt class="py-param">scene</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addLampToScene-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addLampToScene-expanded"><a name="L739"></a><tt class="py-lineno"> 739</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L740"></a><tt class="py-lineno"> 740</tt>  <tt class="py-line"><tt class="py-docstring">        Add a light to the scene</tt> </tt>
<a name="L741"></a><tt class="py-lineno"> 741</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L742"></a><tt class="py-lineno"> 742</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L743"></a><tt class="py-lineno"> 743</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the instance</tt> </tt>
<a name="L744"></a><tt class="py-lineno"> 744</tt>  <tt class="py-line"><tt class="py-docstring">        @type  Type: light hostType/int etc..</tt> </tt>
<a name="L745"></a><tt class="py-lineno"> 745</tt>  <tt class="py-line"><tt class="py-docstring">        @param Type: the light type : spot,sun,omni,etc..</tt> </tt>
<a name="L746"></a><tt class="py-lineno"> 746</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rgb: list of int 0-255</tt> </tt>
<a name="L747"></a><tt class="py-lineno"> 747</tt>  <tt class="py-line"><tt class="py-docstring">        @param rgb: color of the light in rgb</tt> </tt>
<a name="L748"></a><tt class="py-lineno"> 748</tt>  <tt class="py-line"><tt class="py-docstring">        @type  dist: float</tt> </tt>
<a name="L749"></a><tt class="py-lineno"> 749</tt>  <tt class="py-line"><tt class="py-docstring">        @param dist: light distance of attenuation</tt> </tt>
<a name="L750"></a><tt class="py-lineno"> 750</tt>  <tt class="py-line"><tt class="py-docstring">        @type  energy: float</tt> </tt>
<a name="L751"></a><tt class="py-lineno"> 751</tt>  <tt class="py-line"><tt class="py-docstring">        @param energy: intensity of the light</tt> </tt>
<a name="L752"></a><tt class="py-lineno"> 752</tt>  <tt class="py-line"><tt class="py-docstring">        @type  soft: bool</tt> </tt>
<a name="L753"></a><tt class="py-lineno"> 753</tt>  <tt class="py-line"><tt class="py-docstring">        @param soft: soft light</tt> </tt>
<a name="L754"></a><tt class="py-lineno"> 754</tt>  <tt class="py-line"><tt class="py-docstring">        @type  shadow: boolean</tt> </tt>
<a name="L755"></a><tt class="py-lineno"> 755</tt>  <tt class="py-line"><tt class="py-docstring">        @param shadow: does the light produce shadow</tt> </tt>
<a name="L756"></a><tt class="py-lineno"> 756</tt>  <tt class="py-line"><tt class="py-docstring">        @type  scene: host scene</tt> </tt>
<a name="L757"></a><tt class="py-lineno"> 757</tt>  <tt class="py-line"><tt class="py-docstring">        @param scene: the scene</tt> </tt>
<a name="L758"></a><tt class="py-lineno"> 758</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L759"></a><tt class="py-lineno"> 759</tt>  <tt class="py-line">        <tt class="py-name">dicType</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">'Area'</tt><tt class="py-op">:</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-string">'Sun'</tt><tt class="py-op">:</tt><tt class="py-number">3</tt><tt class="py-op">}</tt> </tt>
<a name="L760"></a><tt class="py-lineno"> 760</tt>  <tt class="py-line">        <tt class="py-name">lamp</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-comment">#c4d.BaseObject(LIGHT)</tt> </tt>
<a name="L761"></a><tt class="py-lineno"> 761</tt>  <tt class="py-line">        <tt class="py-comment">#lamp name (name)</tt> </tt>
<a name="L762"></a><tt class="py-lineno"> 762</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#lamp position (center)</tt> </tt>
<a name="L763"></a><tt class="py-lineno"> 763</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#lamp color (float(rgb[0]), float(rgb[1]), float(rgb[2]))#color</tt> </tt>
<a name="L764"></a><tt class="py-lineno"> 764</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#lamp energy  float(energy) #intensity</tt> </tt>
<a name="L765"></a><tt class="py-lineno"> 765</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#lamp type dicType[Type] #type</tt> </tt>
<a name="L766"></a><tt class="py-lineno"> 766</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">shadow</tt> <tt class="py-op">:</tt>  </tt>
<a name="L767"></a><tt class="py-lineno"> 767</tt>  <tt class="py-line">            <tt class="py-comment">#lampe shadow </tt> </tt>
<a name="L768"></a><tt class="py-lineno"> 768</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
<a name="L769"></a><tt class="py-lineno"> 769</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-48" class="py-name"><a title="upy.hostHelper.Helper.addObjectToScene" class="py-name" href="#" onclick="return doclink('link-48', 'addObjectToScene', 'link-44');">addObjectToScene</a></tt><tt class="py-op">(</tt><tt class="py-name">scene</tt><tt class="py-op">,</tt><tt class="py-name">lamp</tt><tt class="py-op">,</tt><tt class="py-name">centerRoot</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt>     </tt>
<a name="L770"></a><tt class="py-lineno"> 770</tt>  <tt class="py-line">        <tt class="py-string">"""</tt> </tt>
<a name="L771"></a><tt class="py-lineno"> 771</tt>  <tt class="py-line"><tt class="py-string">        lampe.setDist(dist)</tt> </tt>
<a name="L772"></a><tt class="py-lineno"> 772</tt>  <tt class="py-line"><tt class="py-string">        lampe.setSoftness(soft)</tt> </tt>
<a name="L773"></a><tt class="py-lineno"> 773</tt>  <tt class="py-line"><tt class="py-string">        """</tt> </tt>
</div><a name="L774"></a><tt class="py-lineno"> 774</tt>  <tt class="py-line"> </tt>
<a name="Helper.newEmpty"></a><div id="Helper.newEmpty-def"><a name="L775"></a><tt class="py-lineno"> 775</tt> <a class="py-toggle" href="#" id="Helper.newEmpty-toggle" onclick="return toggle('Helper.newEmpty');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#newEmpty">newEmpty</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">location</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">parentCenter</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.newEmpty-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.newEmpty-expanded"><a name="L776"></a><tt class="py-lineno"> 776</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L777"></a><tt class="py-lineno"> 777</tt>  <tt class="py-line"><tt class="py-docstring">        Create a new Null Object</tt> </tt>
<a name="L778"></a><tt class="py-lineno"> 778</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L779"></a><tt class="py-lineno"> 779</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L780"></a><tt class="py-lineno"> 780</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the empty</tt> </tt>
<a name="L781"></a><tt class="py-lineno"> 781</tt>  <tt class="py-line"><tt class="py-docstring">        @type  location: list</tt> </tt>
<a name="L782"></a><tt class="py-lineno"> 782</tt>  <tt class="py-line"><tt class="py-docstring">        @param location: position of the null object</tt> </tt>
<a name="L783"></a><tt class="py-lineno"> 783</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parentCenter: list</tt> </tt>
<a name="L784"></a><tt class="py-lineno"> 784</tt>  <tt class="py-line"><tt class="py-docstring">        @param parentCenter: position of the parent object</tt> </tt>
<a name="L785"></a><tt class="py-lineno"> 785</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L786"></a><tt class="py-lineno"> 786</tt>  <tt class="py-line"><tt class="py-docstring">        @type kw: dictionary</tt> </tt>
<a name="L787"></a><tt class="py-lineno"> 787</tt>  <tt class="py-line"><tt class="py-docstring">        @param kw: you can add your own keyword</tt> </tt>
<a name="L788"></a><tt class="py-lineno"> 788</tt>  <tt class="py-line"><tt class="py-docstring">       </tt> </tt>
<a name="L789"></a><tt class="py-lineno"> 789</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L790"></a><tt class="py-lineno"> 790</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the null object</tt> </tt>
<a name="L791"></a><tt class="py-lineno"> 791</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L792"></a><tt class="py-lineno"> 792</tt>  <tt class="py-line">        <tt class="py-name">empty</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-comment">#</tt> </tt>
<a name="L793"></a><tt class="py-lineno"> 793</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">location</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L794"></a><tt class="py-lineno"> 794</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">parentCenter</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt>  </tt>
<a name="L795"></a><tt class="py-lineno"> 795</tt>  <tt class="py-line">                <tt class="py-name">location</tt> <tt class="py-op">=</tt> <tt class="py-name">location</tt> <tt class="py-op">-</tt> <tt class="py-name">parentCenter</tt> </tt>
<a name="L796"></a><tt class="py-lineno"> 796</tt>  <tt class="py-line">            <tt class="py-comment">#set the position of the object to location       </tt> </tt>
<a name="L797"></a><tt class="py-lineno"> 797</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">empty</tt> </tt>
</div><a name="L798"></a><tt class="py-lineno"> 798</tt>  <tt class="py-line">     </tt>
<a name="Helper.newInstance"></a><div id="Helper.newInstance-def"><a name="L799"></a><tt class="py-lineno"> 799</tt> <a class="py-toggle" href="#" id="Helper.newInstance-toggle" onclick="return toggle('Helper.newInstance');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#newInstance">newInstance</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">location</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">hostmatrice</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">matrice</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.newInstance-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.newInstance-expanded"><a name="L800"></a><tt class="py-lineno"> 800</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L801"></a><tt class="py-lineno"> 801</tt>  <tt class="py-line"><tt class="py-docstring">        Create a new Instance from another Object</tt> </tt>
<a name="L802"></a><tt class="py-lineno"> 802</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L803"></a><tt class="py-lineno"> 803</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L804"></a><tt class="py-lineno"> 804</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the instance</tt> </tt>
<a name="L805"></a><tt class="py-lineno"> 805</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L806"></a><tt class="py-lineno"> 806</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object to herit from   </tt> </tt>
<a name="L807"></a><tt class="py-lineno"> 807</tt>  <tt class="py-line"><tt class="py-docstring">        @type  location: list/Vector</tt> </tt>
<a name="L808"></a><tt class="py-lineno"> 808</tt>  <tt class="py-line"><tt class="py-docstring">        @param location: position of the null object</tt> </tt>
<a name="L809"></a><tt class="py-lineno"> 809</tt>  <tt class="py-line"><tt class="py-docstring">        @type  hostmatrice: list/Matrix </tt> </tt>
<a name="L810"></a><tt class="py-lineno"> 810</tt>  <tt class="py-line"><tt class="py-docstring">        @param hostmatrice: transformation matrix in host format</tt> </tt>
<a name="L811"></a><tt class="py-lineno"> 811</tt>  <tt class="py-line"><tt class="py-docstring">        @type  matrice: list/Matrix</tt> </tt>
<a name="L812"></a><tt class="py-lineno"> 812</tt>  <tt class="py-line"><tt class="py-docstring">        @param matrice: transformation matrix in epmv/numpy format</tt> </tt>
<a name="L813"></a><tt class="py-lineno"> 813</tt>  <tt class="py-line"><tt class="py-docstring">       </tt> </tt>
<a name="L814"></a><tt class="py-lineno"> 814</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L815"></a><tt class="py-lineno"> 815</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the instance object</tt> </tt>
<a name="L816"></a><tt class="py-lineno"> 816</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L817"></a><tt class="py-lineno"> 817</tt>  <tt class="py-line">        <tt class="py-comment">#instance = None#</tt> </tt>
<a name="L818"></a><tt class="py-lineno"> 818</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#instance parent = object  </tt> </tt>
<a name="L819"></a><tt class="py-lineno"> 819</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#instance name = name</tt> </tt>
<a name="L820"></a><tt class="py-lineno"> 820</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">location</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L821"></a><tt class="py-lineno"> 821</tt>  <tt class="py-line">            <tt class="py-comment">#set the position of instance with location</tt> </tt>
<a name="L822"></a><tt class="py-lineno"> 822</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
<a name="L823"></a><tt class="py-lineno"> 823</tt>  <tt class="py-line">        <tt class="py-comment">#set the instance matrice</tt> </tt>
<a name="L824"></a><tt class="py-lineno"> 824</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-49" class="py-name" targets="Method upy.hostHelper.Helper.setObjectMatrix()=upy.hostHelper.Helper-class.html#setObjectMatrix"><a title="upy.hostHelper.Helper.setObjectMatrix" class="py-name" href="#" onclick="return doclink('link-49', 'setObjectMatrix', 'link-49');">setObjectMatrix</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">,</tt><tt class="py-name">matrice</tt><tt class="py-op">=</tt><tt class="py-name">matrice</tt><tt class="py-op">,</tt><tt class="py-name">hostmatrice</tt><tt class="py-op">=</tt><tt class="py-name">hostmatrice</tt><tt class="py-op">)</tt> </tt>
<a name="L825"></a><tt class="py-lineno"> 825</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">instance</tt> </tt>
</div><a name="L826"></a><tt class="py-lineno"> 826</tt>  <tt class="py-line">    </tt>
<a name="Helper.translateObj"></a><div id="Helper.translateObj-def"><a name="L827"></a><tt class="py-lineno"> 827</tt> <a class="py-toggle" href="#" id="Helper.translateObj-toggle" onclick="return toggle('Helper.translateObj');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#translateObj">translateObj</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">position</tt><tt class="py-op">,</tt><tt class="py-param">use_parent</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.translateObj-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.translateObj-expanded"><a name="L828"></a><tt class="py-lineno"> 828</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L829"></a><tt class="py-lineno"> 829</tt>  <tt class="py-line"><tt class="py-docstring">        Translation : Move the object to the vector position </tt> </tt>
<a name="L830"></a><tt class="py-lineno"> 830</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L831"></a><tt class="py-lineno"> 831</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L832"></a><tt class="py-lineno"> 832</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object   </tt> </tt>
<a name="L833"></a><tt class="py-lineno"> 833</tt>  <tt class="py-line"><tt class="py-docstring">        @type  position: liste/array</tt> </tt>
<a name="L834"></a><tt class="py-lineno"> 834</tt>  <tt class="py-line"><tt class="py-docstring">        @param position: the new object position px,py,pz  </tt> </tt>
<a name="L835"></a><tt class="py-lineno"> 835</tt>  <tt class="py-line"><tt class="py-docstring">        @type  use_parent: boolean</tt> </tt>
<a name="L836"></a><tt class="py-lineno"> 836</tt>  <tt class="py-line"><tt class="py-docstring">        @param use_parent: if the parent position is used</tt> </tt>
<a name="L837"></a><tt class="py-lineno"> 837</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L838"></a><tt class="py-lineno"> 838</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L839"></a><tt class="py-lineno"> 839</tt>  <tt class="py-line">     </tt>
<a name="Helper.scaleObj"></a><div id="Helper.scaleObj-def"><a name="L840"></a><tt class="py-lineno"> 840</tt> <a class="py-toggle" href="#" id="Helper.scaleObj-toggle" onclick="return toggle('Helper.scaleObj');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#scaleObj">scaleObj</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">sc</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.scaleObj-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.scaleObj-expanded"><a name="L841"></a><tt class="py-lineno"> 841</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L842"></a><tt class="py-lineno"> 842</tt>  <tt class="py-line"><tt class="py-docstring">        Scale : scale the object by the vector scale </tt> </tt>
<a name="L843"></a><tt class="py-lineno"> 843</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L844"></a><tt class="py-lineno"> 844</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L845"></a><tt class="py-lineno"> 845</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object   </tt> </tt>
<a name="L846"></a><tt class="py-lineno"> 846</tt>  <tt class="py-line"><tt class="py-docstring">        @type  sc: float or liste/array</tt> </tt>
<a name="L847"></a><tt class="py-lineno"> 847</tt>  <tt class="py-line"><tt class="py-docstring">        @param sc: the scale vector s,s,s or sx,sy,sz  </tt> </tt>
<a name="L848"></a><tt class="py-lineno"> 848</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L849"></a><tt class="py-lineno"> 849</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L850"></a><tt class="py-lineno"> 850</tt>  <tt class="py-line">         </tt>
<a name="Helper.rotateObj"></a><div id="Helper.rotateObj-def"><a name="L851"></a><tt class="py-lineno"> 851</tt> <a class="py-toggle" href="#" id="Helper.rotateObj-toggle" onclick="return toggle('Helper.rotateObj');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#rotateObj">rotateObj</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">rotation</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.rotateObj-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.rotateObj-expanded"><a name="L852"></a><tt class="py-lineno"> 852</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L853"></a><tt class="py-lineno"> 853</tt>  <tt class="py-line"><tt class="py-docstring">        Translation : Move the object to the vector position </tt> </tt>
<a name="L854"></a><tt class="py-lineno"> 854</tt>  <tt class="py-line"><tt class="py-docstring">        This method could take either, a matrice, a euler array, a quaternion...</tt> </tt>
<a name="L855"></a><tt class="py-lineno"> 855</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L856"></a><tt class="py-lineno"> 856</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L857"></a><tt class="py-lineno"> 857</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object   </tt> </tt>
<a name="L858"></a><tt class="py-lineno"> 858</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rotation: liste/array - matrice</tt> </tt>
<a name="L859"></a><tt class="py-lineno"> 859</tt>  <tt class="py-line"><tt class="py-docstring">        @param rotation: the new object rotation  </tt> </tt>
<a name="L860"></a><tt class="py-lineno"> 860</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L861"></a><tt class="py-lineno"> 861</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L862"></a><tt class="py-lineno"> 862</tt>  <tt class="py-line"> </tt>
<a name="L863"></a><tt class="py-lineno"> 863</tt>  <tt class="py-line"> </tt>
<a name="Helper.getTranslation"></a><div id="Helper.getTranslation-def"><a name="L864"></a><tt class="py-lineno"> 864</tt> <a class="py-toggle" href="#" id="Helper.getTranslation-toggle" onclick="return toggle('Helper.getTranslation');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getTranslation">getTranslation</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">absolue</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getTranslation-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getTranslation-expanded"><a name="L865"></a><tt class="py-lineno"> 865</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L866"></a><tt class="py-lineno"> 866</tt>  <tt class="py-line"><tt class="py-docstring">        Return the current position (translation)  of the  given object in absolute or local world</tt> </tt>
<a name="L867"></a><tt class="py-lineno"> 867</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L868"></a><tt class="py-lineno"> 868</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: hostObject</tt> </tt>
<a name="L869"></a><tt class="py-lineno"> 869</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: the object name</tt> </tt>
<a name="L870"></a><tt class="py-lineno"> 870</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L871"></a><tt class="py-lineno"> 871</tt>  <tt class="py-line"><tt class="py-docstring">       </tt> </tt>
<a name="L872"></a><tt class="py-lineno"> 872</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   3d vector/list</tt> </tt>
<a name="L873"></a><tt class="py-lineno"> 873</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the position   </tt> </tt>
<a name="L874"></a><tt class="py-lineno"> 874</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L875"></a><tt class="py-lineno"> 875</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt> </tt>
</div><a name="L876"></a><tt class="py-lineno"> 876</tt>  <tt class="py-line">         </tt>
<a name="L877"></a><tt class="py-lineno"> 877</tt>  <tt class="py-line"> </tt>
<a name="Helper.toggleDisplay"></a><div id="Helper.toggleDisplay-def"><a name="L878"></a><tt class="py-lineno"> 878</tt> <a class="py-toggle" href="#" id="Helper.toggleDisplay-toggle" onclick="return toggle('Helper.toggleDisplay');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#toggleDisplay">toggleDisplay</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">display</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.toggleDisplay-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.toggleDisplay-expanded"><a name="L879"></a><tt class="py-lineno"> 879</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L880"></a><tt class="py-lineno"> 880</tt>  <tt class="py-line"><tt class="py-docstring">        Toggle on/off the display/visibility/rendermode of an hostObject in the host viewport</tt> </tt>
<a name="L881"></a><tt class="py-lineno"> 881</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L882"></a><tt class="py-lineno"> 882</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L883"></a><tt class="py-lineno"> 883</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object   </tt> </tt>
<a name="L884"></a><tt class="py-lineno"> 884</tt>  <tt class="py-line"><tt class="py-docstring">        @type  display: boolean</tt> </tt>
<a name="L885"></a><tt class="py-lineno"> 885</tt>  <tt class="py-line"><tt class="py-docstring">        @param display: if the object is displayed</tt> </tt>
<a name="L886"></a><tt class="py-lineno"> 886</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
</div><a name="L887"></a><tt class="py-lineno"> 887</tt>  <tt class="py-line"> </tt>
<a name="L888"></a><tt class="py-lineno"> 888</tt>  <tt class="py-line">     </tt>
<a name="Helper.getVisibility"></a><div id="Helper.getVisibility-def"><a name="L889"></a><tt class="py-lineno"> 889</tt> <a class="py-toggle" href="#" id="Helper.getVisibility-toggle" onclick="return toggle('Helper.getVisibility');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getVisibility">getVisibility</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">,</tt><tt class="py-param">editor</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> <tt class="py-param">render</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> <tt class="py-param">active</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>     </tt>
</div><a name="L890"></a><tt class="py-lineno"> 890</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L891"></a><tt class="py-lineno"> 891</tt>  <tt class="py-line"><tt class="py-docstring">        return the editor/renedring/active visibility state of the given object</tt> </tt>
<a name="L892"></a><tt class="py-lineno"> 892</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L893"></a><tt class="py-lineno"> 893</tt>  <tt class="py-line"><tt class="py-docstring">        @type  obj: hostObject</tt> </tt>
<a name="L894"></a><tt class="py-lineno"> 894</tt>  <tt class="py-line"><tt class="py-docstring">        @param obj: the object   </tt> </tt>
<a name="L895"></a><tt class="py-lineno"> 895</tt>  <tt class="py-line"><tt class="py-docstring">        @type  editor: boolean</tt> </tt>
<a name="L896"></a><tt class="py-lineno"> 896</tt>  <tt class="py-line"><tt class="py-docstring">        @param editor: request editor visibility</tt> </tt>
<a name="L897"></a><tt class="py-lineno"> 897</tt>  <tt class="py-line"><tt class="py-docstring">        @type  render: boolean</tt> </tt>
<a name="L898"></a><tt class="py-lineno"> 898</tt>  <tt class="py-line"><tt class="py-docstring">        @param render: request rendering visibility</tt> </tt>
<a name="L899"></a><tt class="py-lineno"> 899</tt>  <tt class="py-line"><tt class="py-docstring">        @type  active: boolean</tt> </tt>
<a name="L900"></a><tt class="py-lineno"> 900</tt>  <tt class="py-line"><tt class="py-docstring">        @param active: request active states ie C4D</tt> </tt>
<a name="L901"></a><tt class="py-lineno"> 901</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L902"></a><tt class="py-lineno"> 902</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   bool/array of bool</tt> </tt>
<a name="L903"></a><tt class="py-lineno"> 903</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the current visibility state of the object</tt> </tt>
<a name="L904"></a><tt class="py-lineno"> 904</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L905"></a><tt class="py-lineno"> 905</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L906"></a><tt class="py-lineno"> 906</tt>  <tt class="py-line">     </tt>
<a name="L907"></a><tt class="py-lineno"> 907</tt>  <tt class="py-line">     </tt>
<a name="Helper.toggleEditMode"></a><div id="Helper.toggleEditMode-def"><a name="L908"></a><tt class="py-lineno"> 908</tt> <a class="py-toggle" href="#" id="Helper.toggleEditMode-toggle" onclick="return toggle('Helper.toggleEditMode');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#toggleEditMode">toggleEditMode</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.toggleEditMode-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.toggleEditMode-expanded"><a name="L909"></a><tt class="py-lineno"> 909</tt>  <tt class="py-line">        <tt class="py-docstring">"""Turn off edit mode (if any)"""</tt> </tt>
<a name="L910"></a><tt class="py-lineno"> 910</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L911"></a><tt class="py-lineno"> 911</tt>  <tt class="py-line"> </tt>
<a name="Helper.restoreEditMode"></a><div id="Helper.restoreEditMode-def"><a name="L912"></a><tt class="py-lineno"> 912</tt> <a class="py-toggle" href="#" id="Helper.restoreEditMode-toggle" onclick="return toggle('Helper.restoreEditMode');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#restoreEditMode">restoreEditMode</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">editmode</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.restoreEditMode-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.restoreEditMode-expanded"><a name="L913"></a><tt class="py-lineno"> 913</tt>  <tt class="py-line">        <tt class="py-docstring">"""Restor any edit mode"""</tt> </tt>
<a name="L914"></a><tt class="py-lineno"> 914</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L915"></a><tt class="py-lineno"> 915</tt>  <tt class="py-line">     </tt>
<a name="Helper.setObjectMatrix"></a><div id="Helper.setObjectMatrix-def"><a name="L916"></a><tt class="py-lineno"> 916</tt> <a class="py-toggle" href="#" id="Helper.setObjectMatrix-toggle" onclick="return toggle('Helper.setObjectMatrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#setObjectMatrix">setObjectMatrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">matrice</tt><tt class="py-op">,</tt><tt class="py-param">hostmatrice</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.setObjectMatrix-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.setObjectMatrix-expanded"><a name="L917"></a><tt class="py-lineno"> 917</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L918"></a><tt class="py-lineno"> 918</tt>  <tt class="py-line"><tt class="py-docstring">        set a matrix to an hostObject</tt> </tt>
<a name="L919"></a><tt class="py-lineno"> 919</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L920"></a><tt class="py-lineno"> 920</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L921"></a><tt class="py-lineno"> 921</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object who receive the transformation </tt> </tt>
<a name="L922"></a><tt class="py-lineno"> 922</tt>  <tt class="py-line"><tt class="py-docstring">        @type  hostmatrice: list/Matrix </tt> </tt>
<a name="L923"></a><tt class="py-lineno"> 923</tt>  <tt class="py-line"><tt class="py-docstring">        @param hostmatrice: transformation matrix in host format</tt> </tt>
<a name="L924"></a><tt class="py-lineno"> 924</tt>  <tt class="py-line"><tt class="py-docstring">        @type  matrice: list/Matrix</tt> </tt>
<a name="L925"></a><tt class="py-lineno"> 925</tt>  <tt class="py-line"><tt class="py-docstring">        @param matrice: transformation matrix in epmv/numpy format</tt> </tt>
<a name="L926"></a><tt class="py-lineno"> 926</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L927"></a><tt class="py-lineno"> 927</tt>  <tt class="py-line">     </tt>
<a name="L928"></a><tt class="py-lineno"> 928</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">hostmatrice</tt> <tt class="py-op">!=</tt><tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L929"></a><tt class="py-lineno"> 929</tt>  <tt class="py-line">            <tt class="py-comment">#set the instance matrice</tt> </tt>
<a name="L930"></a><tt class="py-lineno"> 930</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
<a name="L931"></a><tt class="py-lineno"> 931</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">matrice</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L932"></a><tt class="py-lineno"> 932</tt>  <tt class="py-line">            <tt class="py-comment">#convert the matrice in host format</tt> </tt>
<a name="L933"></a><tt class="py-lineno"> 933</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#set the instance matrice</tt> </tt>
<a name="L934"></a><tt class="py-lineno"> 934</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
</div><a name="L935"></a><tt class="py-lineno"> 935</tt>  <tt class="py-line"> </tt>
<a name="Helper.concatObjectMatrix"></a><div id="Helper.concatObjectMatrix-def"><a name="L936"></a><tt class="py-lineno"> 936</tt> <a class="py-toggle" href="#" id="Helper.concatObjectMatrix-toggle" onclick="return toggle('Helper.concatObjectMatrix');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#concatObjectMatrix">concatObjectMatrix</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">matrice</tt><tt class="py-op">,</tt><tt class="py-param">hostmatrice</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.concatObjectMatrix-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.concatObjectMatrix-expanded"><a name="L937"></a><tt class="py-lineno"> 937</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L938"></a><tt class="py-lineno"> 938</tt>  <tt class="py-line"><tt class="py-docstring">        apply a matrix to an hostObject</tt> </tt>
<a name="L939"></a><tt class="py-lineno"> 939</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L940"></a><tt class="py-lineno"> 940</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostObject</tt> </tt>
<a name="L941"></a><tt class="py-lineno"> 941</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object who receive the transformation</tt> </tt>
<a name="L942"></a><tt class="py-lineno"> 942</tt>  <tt class="py-line"><tt class="py-docstring">        @type  hostmatrice: list/Matrix </tt> </tt>
<a name="L943"></a><tt class="py-lineno"> 943</tt>  <tt class="py-line"><tt class="py-docstring">        @param hostmatrice: transformation matrix in host format</tt> </tt>
<a name="L944"></a><tt class="py-lineno"> 944</tt>  <tt class="py-line"><tt class="py-docstring">        @type  matrice: list/Matrix</tt> </tt>
<a name="L945"></a><tt class="py-lineno"> 945</tt>  <tt class="py-line"><tt class="py-docstring">        @param matrice: transformation matrix in epmv/numpy format</tt> </tt>
<a name="L946"></a><tt class="py-lineno"> 946</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L947"></a><tt class="py-lineno"> 947</tt>  <tt class="py-line">        <tt class="py-comment">#get current transformation</tt> </tt>
<a name="L948"></a><tt class="py-lineno"> 948</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">hostmatrice</tt> <tt class="py-op">!=</tt><tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L949"></a><tt class="py-lineno"> 949</tt>  <tt class="py-line">            <tt class="py-comment">#compute the new matrix: matrice*current</tt> </tt>
<a name="L950"></a><tt class="py-lineno"> 950</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#set the new matrice</tt> </tt>
<a name="L951"></a><tt class="py-lineno"> 951</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
<a name="L952"></a><tt class="py-lineno"> 952</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">matrice</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L953"></a><tt class="py-lineno"> 953</tt>  <tt class="py-line">            <tt class="py-comment">#convert the matrice in host format</tt> </tt>
<a name="L954"></a><tt class="py-lineno"> 954</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#compute the new matrix: matrice*current</tt> </tt>
<a name="L955"></a><tt class="py-lineno"> 955</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#set the new matrice</tt> </tt>
<a name="L956"></a><tt class="py-lineno"> 956</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt> </tt>
</div><a name="L957"></a><tt class="py-lineno"> 957</tt>  <tt class="py-line"> </tt>
<a name="Helper.updateTubeObjs"></a><div id="Helper.updateTubeObjs-def"><a name="L958"></a><tt class="py-lineno"> 958</tt> <a class="py-toggle" href="#" id="Helper.updateTubeObjs-toggle" onclick="return toggle('Helper.updateTubeObjs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#updateTubeObjs">updateTubeObjs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">listeObj</tt><tt class="py-op">,</tt><tt class="py-param">listePts</tt><tt class="py-op">,</tt><tt class="py-param">listeInd</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.updateTubeObjs-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.updateTubeObjs-expanded"><a name="L959"></a><tt class="py-lineno"> 959</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">listeInd</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L960"></a><tt class="py-lineno"> 960</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">updateTubeObj</tt><tt class="py-op">(</tt><tt class="py-name">listeObj</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">listePts</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">listePts</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">+</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> \ </tt>
<a name="L961"></a><tt class="py-lineno"> 961</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">j</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listeObj</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listePts</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L962"></a><tt class="py-lineno"> 962</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L963"></a><tt class="py-lineno"> 963</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">updateTubeObj</tt><tt class="py-op">(</tt><tt class="py-name">listeObj</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">listePts</tt><tt class="py-op">[</tt><tt class="py-name">listeInd</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">listePts</tt><tt class="py-op">[</tt><tt class="py-name">listeInd</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> \ </tt>
<a name="L964"></a><tt class="py-lineno"> 964</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">j</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">listeObj</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L965"></a><tt class="py-lineno"> 965</tt>  <tt class="py-line"> </tt>
<a name="Helper.convertColor"></a><div id="Helper.convertColor-def"><a name="L966"></a><tt class="py-lineno"> 966</tt> <a class="py-toggle" href="#" id="Helper.convertColor-toggle" onclick="return toggle('Helper.convertColor');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#convertColor">convertColor</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">col</tt><tt class="py-op">,</tt><tt class="py-param">toint</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.convertColor-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.convertColor-expanded"><a name="L967"></a><tt class="py-lineno"> 967</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L968"></a><tt class="py-lineno"> 968</tt>  <tt class="py-line"><tt class="py-docstring">        This function will convert a color array [r,g,b] from range 1-255 </tt> </tt>
<a name="L969"></a><tt class="py-lineno"> 969</tt>  <tt class="py-line"><tt class="py-docstring">        to range 0.-1 (vice/versa)</tt> </tt>
<a name="L970"></a><tt class="py-lineno"> 970</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L971"></a><tt class="py-lineno"> 971</tt>  <tt class="py-line"><tt class="py-docstring">        @type  col: array</tt> </tt>
<a name="L972"></a><tt class="py-lineno"> 972</tt>  <tt class="py-line"><tt class="py-docstring">        @param col: the color [r,g,b]</tt> </tt>
<a name="L973"></a><tt class="py-lineno"> 973</tt>  <tt class="py-line"><tt class="py-docstring">        @type  toint: boolean</tt> </tt>
<a name="L974"></a><tt class="py-lineno"> 974</tt>  <tt class="py-line"><tt class="py-docstring">        @param toint: way of the convertion, if true convert to 1-255, if false</tt> </tt>
<a name="L975"></a><tt class="py-lineno"> 975</tt>  <tt class="py-line"><tt class="py-docstring">        convert to range 0-1</tt> </tt>
<a name="L976"></a><tt class="py-lineno"> 976</tt>  <tt class="py-line"><tt class="py-docstring">       </tt> </tt>
<a name="L977"></a><tt class="py-lineno"> 977</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   array</tt> </tt>
<a name="L978"></a><tt class="py-lineno"> 978</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the converted color [0-1.,0-1.,0-1.] or [1-255,1-255,1-255]</tt> </tt>
<a name="L979"></a><tt class="py-lineno"> 979</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L980"></a><tt class="py-lineno"> 980</tt>  <tt class="py-line">        <tt class="py-comment">#its seems that pymol color for instance are in range 0. 1.00001 ?</tt> </tt>
<a name="L981"></a><tt class="py-lineno"> 981</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">toint</tt> <tt class="py-keyword">and</tt> <tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-name">col</tt><tt class="py-op">)</tt><tt class="py-op">&lt;=</tt><tt class="py-number">1.00001</tt><tt class="py-op">:</tt> <tt class="py-name">col</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt id="link-50" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-50', 'x', 'link-20');">x</a></tt><tt class="py-op">*</tt><tt class="py-number">255</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt id="link-51" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-51', 'x', 'link-20');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">col</tt><tt class="py-op">]</tt> </tt>
<a name="L982"></a><tt class="py-lineno"> 982</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">toint</tt> <tt class="py-keyword">and</tt> <tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-name">col</tt><tt class="py-op">)</tt><tt class="py-op">&gt;</tt><tt class="py-number">1.00001</tt><tt class="py-op">:</tt> <tt class="py-name">col</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt id="link-52" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-52', 'x', 'link-20');">x</a></tt><tt class="py-op">/</tt><tt class="py-number">255.</tt> <tt class="py-keyword">for</tt> <tt id="link-53" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-53', 'x', 'link-20');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">col</tt><tt class="py-op">]</tt> </tt>
<a name="L983"></a><tt class="py-lineno"> 983</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">col</tt> </tt>
</div><a name="L984"></a><tt class="py-lineno"> 984</tt>  <tt class="py-line">         </tt>
<a name="Helper.addMaterialFromDic"></a><div id="Helper.addMaterialFromDic-def"><a name="L985"></a><tt class="py-lineno"> 985</tt> <a class="py-toggle" href="#" id="Helper.addMaterialFromDic-toggle" onclick="return toggle('Helper.addMaterialFromDic');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addMaterialFromDic">addMaterialFromDic</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">dic</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addMaterialFromDic-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addMaterialFromDic-expanded"><a name="L986"></a><tt class="py-lineno"> 986</tt>  <tt class="py-line">        <tt class="py-comment">#dic: Name:Color</tt> </tt>
<a name="L987"></a><tt class="py-lineno"> 987</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-54" class="py-name" targets="Method upy.hostHelper.Helper.addMaterial()=upy.hostHelper.Helper-class.html#addMaterial"><a title="upy.hostHelper.Helper.addMaterial" class="py-name" href="#" onclick="return doclink('link-54', 'addMaterial', 'link-54');">addMaterial</a></tt><tt class="py-op">(</tt><tt id="link-55" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-55', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt class="py-name">dic</tt><tt class="py-op">[</tt><tt id="link-56" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-56', 'x', 'link-20');">x</a></tt><tt class="py-op">]</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt id="link-57" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-57', 'x', 'link-20');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">dic</tt><tt class="py-op">.</tt><tt class="py-name">keys</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
</div><a name="L988"></a><tt class="py-lineno"> 988</tt>  <tt class="py-line"> </tt>
<a name="Helper.createColorsMat"></a><div id="Helper.createColorsMat-def"><a name="L989"></a><tt class="py-lineno"> 989</tt> <a class="py-toggle" href="#" id="Helper.createColorsMat-toggle" onclick="return toggle('Helper.createColorsMat');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#createColorsMat">createColorsMat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.createColorsMat-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.createColorsMat-expanded"><a name="L990"></a><tt class="py-lineno"> 990</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L991"></a><tt class="py-lineno"> 991</tt>  <tt class="py-line"><tt class="py-docstring">        Create a Material for all defined colors</tt> </tt>
<a name="L992"></a><tt class="py-lineno"> 992</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L993"></a><tt class="py-lineno"> 993</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list</tt> </tt>
<a name="L994"></a><tt class="py-lineno"> 994</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the list of the new colors material </tt> </tt>
<a name="L995"></a><tt class="py-lineno"> 995</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>             </tt>
<a name="L996"></a><tt class="py-lineno"> 996</tt>  <tt class="py-line">        <tt class="py-name">Mat</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L997"></a><tt class="py-lineno"> 997</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">col</tt> <tt class="py-keyword">in</tt> <tt id="link-58" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-58', 'colors', 'link-4');">colors</a></tt><tt class="py-op">.</tt><tt id="link-59" class="py-name" targets="Variable upy.colors.cnames=upy.colors-module.html#cnames"><a title="upy.colors.cnames" class="py-name" href="#" onclick="return doclink('link-59', 'cnames', 'link-59');">cnames</a></tt><tt class="py-op">:</tt> </tt>
<a name="L998"></a><tt class="py-lineno"> 998</tt>  <tt class="py-line">            <tt class="py-name">Mat</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-60" class="py-name"><a title="upy.hostHelper.Helper.addMaterial" class="py-name" href="#" onclick="return doclink('link-60', 'addMaterial', 'link-54');">addMaterial</a></tt><tt class="py-op">(</tt><tt class="py-name">col</tt><tt class="py-op">,</tt><tt class="py-name">eval</tt><tt class="py-op">(</tt><tt class="py-string">"colors."</tt><tt class="py-op">+</tt><tt class="py-name">col</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L999"></a><tt class="py-lineno"> 999</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">Mat</tt> </tt>
</div><a name="L1000"></a><tt class="py-lineno">1000</tt>  <tt class="py-line">     </tt>
<a name="Helper.retrieveColorMat"></a><div id="Helper.retrieveColorMat-def"><a name="L1001"></a><tt class="py-lineno">1001</tt> <a class="py-toggle" href="#" id="Helper.retrieveColorMat-toggle" onclick="return toggle('Helper.retrieveColorMat');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#retrieveColorMat">retrieveColorMat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">color</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.retrieveColorMat-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.retrieveColorMat-expanded"><a name="L1002"></a><tt class="py-lineno">1002</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1003"></a><tt class="py-lineno">1003</tt>  <tt class="py-line"><tt class="py-docstring">        Retrieve a material in the current document from his color (r,g,b), if his </tt> </tt>
<a name="L1004"></a><tt class="py-lineno">1004</tt>  <tt class="py-line"><tt class="py-docstring">        color correpond to a DejaVu color</tt> </tt>
<a name="L1005"></a><tt class="py-lineno">1005</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1006"></a><tt class="py-lineno">1006</tt>  <tt class="py-line"><tt class="py-docstring">        @type  color: array</tt> </tt>
<a name="L1007"></a><tt class="py-lineno">1007</tt>  <tt class="py-line"><tt class="py-docstring">        @param color: the material color (r,g,b)</tt> </tt>
<a name="L1008"></a><tt class="py-lineno">1008</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1009"></a><tt class="py-lineno">1009</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostMaterial</tt> </tt>
<a name="L1010"></a><tt class="py-lineno">1010</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the material of color color</tt> </tt>
<a name="L1011"></a><tt class="py-lineno">1011</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>             </tt>
<a name="L1012"></a><tt class="py-lineno">1012</tt>  <tt class="py-line">        <tt class="py-name">doc</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-61" class="py-name"><a title="upy.hostHelper.Helper.getCurrentScene" class="py-name" href="#" onclick="return doclink('link-61', 'getCurrentScene', 'link-43');">getCurrentScene</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L1013"></a><tt class="py-lineno">1013</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">col</tt> <tt class="py-keyword">in</tt> <tt id="link-62" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-62', 'colors', 'link-4');">colors</a></tt><tt class="py-op">.</tt><tt id="link-63" class="py-name"><a title="upy.colors.cnames" class="py-name" href="#" onclick="return doclink('link-63', 'cnames', 'link-59');">cnames</a></tt><tt class="py-op">:</tt> </tt>
<a name="L1014"></a><tt class="py-lineno">1014</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">color</tt> <tt class="py-op">==</tt> <tt class="py-name">eval</tt><tt class="py-op">(</tt><tt class="py-string">"colors."</tt><tt class="py-op">+</tt><tt class="py-name">col</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
<a name="L1015"></a><tt class="py-lineno">1015</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-64" class="py-name" targets="Method upy.hostHelper.Helper.getMaterial()=upy.hostHelper.Helper-class.html#getMaterial"><a title="upy.hostHelper.Helper.getMaterial" class="py-name" href="#" onclick="return doclink('link-64', 'getMaterial', 'link-64');">getMaterial</a></tt><tt class="py-op">(</tt><tt class="py-name">col</tt><tt class="py-op">)</tt>     </tt>
<a name="L1016"></a><tt class="py-lineno">1016</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L1017"></a><tt class="py-lineno">1017</tt>  <tt class="py-line">         </tt>
<a name="Helper.addMaterial"></a><div id="Helper.addMaterial-def"><a name="L1018"></a><tt class="py-lineno">1018</tt> <a class="py-toggle" href="#" id="Helper.addMaterial-toggle" onclick="return toggle('Helper.addMaterial');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addMaterial">addMaterial</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">color</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addMaterial-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addMaterial-expanded"><a name="L1019"></a><tt class="py-lineno">1019</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1020"></a><tt class="py-lineno">1020</tt>  <tt class="py-line"><tt class="py-docstring">        Add a material in the current document </tt> </tt>
<a name="L1021"></a><tt class="py-lineno">1021</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1022"></a><tt class="py-lineno">1022</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1023"></a><tt class="py-lineno">1023</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: the material name</tt> </tt>
<a name="L1024"></a><tt class="py-lineno">1024</tt>  <tt class="py-line"><tt class="py-docstring">        @type  color: array</tt> </tt>
<a name="L1025"></a><tt class="py-lineno">1025</tt>  <tt class="py-line"><tt class="py-docstring">        @param color: the material color (r,g,b)</tt> </tt>
<a name="L1026"></a><tt class="py-lineno">1026</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1027"></a><tt class="py-lineno">1027</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostMaterial</tt> </tt>
<a name="L1028"></a><tt class="py-lineno">1028</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the new material </tt> </tt>
<a name="L1029"></a><tt class="py-lineno">1029</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1030"></a><tt class="py-lineno">1030</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1031"></a><tt class="py-lineno">1031</tt>  <tt class="py-line"> </tt>
<a name="Helper.assignMaterial"></a><div id="Helper.assignMaterial-def"><a name="L1032"></a><tt class="py-lineno">1032</tt> <a class="py-toggle" href="#" id="Helper.assignMaterial-toggle" onclick="return toggle('Helper.assignMaterial');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#assignMaterial">assignMaterial</a> <tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">mat</tt><tt class="py-op">,</tt> <tt class="py-param">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.assignMaterial-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.assignMaterial-expanded"><a name="L1033"></a><tt class="py-lineno">1033</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1034"></a><tt class="py-lineno">1034</tt>  <tt class="py-line"><tt class="py-docstring">        Assign the provided material to the object </tt> </tt>
<a name="L1035"></a><tt class="py-lineno">1035</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1036"></a><tt class="py-lineno">1036</tt>  <tt class="py-line"><tt class="py-docstring">        @type  mat: mat</tt> </tt>
<a name="L1037"></a><tt class="py-lineno">1037</tt>  <tt class="py-line"><tt class="py-docstring">        @param mat: the material</tt> </tt>
<a name="L1038"></a><tt class="py-lineno">1038</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: hostApp object</tt> </tt>
<a name="L1039"></a><tt class="py-lineno">1039</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: the object</tt> </tt>
<a name="L1040"></a><tt class="py-lineno">1040</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1041"></a><tt class="py-lineno">1041</tt>  <tt class="py-line">        <tt class="py-comment">#verify if the mat exist, if the string.</tt> </tt>
<a name="L1042"></a><tt class="py-lineno">1042</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#apply it to the object</tt> </tt>
<a name="L1043"></a><tt class="py-lineno">1043</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1044"></a><tt class="py-lineno">1044</tt>  <tt class="py-line"> </tt>
<a name="Helper.colorMaterial"></a><div id="Helper.colorMaterial-def"><a name="L1045"></a><tt class="py-lineno">1045</tt> <a class="py-toggle" href="#" id="Helper.colorMaterial-toggle" onclick="return toggle('Helper.colorMaterial');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#colorMaterial">colorMaterial</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">mat</tt><tt class="py-op">,</tt><tt class="py-param">col</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.colorMaterial-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.colorMaterial-expanded"><a name="L1046"></a><tt class="py-lineno">1046</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1047"></a><tt class="py-lineno">1047</tt>  <tt class="py-line"><tt class="py-docstring">        Color a given material using the given color (r,g,b).</tt> </tt>
<a name="L1048"></a><tt class="py-lineno">1048</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1049"></a><tt class="py-lineno">1049</tt>  <tt class="py-line"><tt class="py-docstring">        @type  mat: hostMaterial</tt> </tt>
<a name="L1050"></a><tt class="py-lineno">1050</tt>  <tt class="py-line"><tt class="py-docstring">        @param mat: the material to change</tt> </tt>
<a name="L1051"></a><tt class="py-lineno">1051</tt>  <tt class="py-line"><tt class="py-docstring">        @type  col: array</tt> </tt>
<a name="L1052"></a><tt class="py-lineno">1052</tt>  <tt class="py-line"><tt class="py-docstring">        @param col: the color (r,g,b)</tt> </tt>
<a name="L1053"></a><tt class="py-lineno">1053</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>  </tt>
<a name="L1054"></a><tt class="py-lineno">1054</tt>  <tt class="py-line">        <tt class="py-comment">#put your code here</tt> </tt>
<a name="L1055"></a><tt class="py-lineno">1055</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#get the materiel if mat is a string for instance</tt> </tt>
<a name="L1056"></a><tt class="py-lineno">1056</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#or verify if the material exist in the current document</tt> </tt>
<a name="L1057"></a><tt class="py-lineno">1057</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#then change his color channel using 'col'</tt> </tt>
<a name="L1058"></a><tt class="py-lineno">1058</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1059"></a><tt class="py-lineno">1059</tt>  <tt class="py-line"> </tt>
<a name="Helper.getMaterial"></a><div id="Helper.getMaterial-def"><a name="L1060"></a><tt class="py-lineno">1060</tt> <a class="py-toggle" href="#" id="Helper.getMaterial-toggle" onclick="return toggle('Helper.getMaterial');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMaterial">getMaterial</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMaterial-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMaterial-expanded"><a name="L1061"></a><tt class="py-lineno">1061</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1062"></a><tt class="py-lineno">1062</tt>  <tt class="py-line"> </tt>
<a name="Helper.getAllMaterials"></a><div id="Helper.getAllMaterials-def"><a name="L1063"></a><tt class="py-lineno">1063</tt> <a class="py-toggle" href="#" id="Helper.getAllMaterials-toggle" onclick="return toggle('Helper.getAllMaterials');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getAllMaterials">getAllMaterials</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getAllMaterials-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getAllMaterials-expanded"><a name="L1064"></a><tt class="py-lineno">1064</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1065"></a><tt class="py-lineno">1065</tt>  <tt class="py-line"> </tt>
<a name="Helper.colorObject"></a><div id="Helper.colorObject-def"><a name="L1066"></a><tt class="py-lineno">1066</tt> <a class="py-toggle" href="#" id="Helper.colorObject-toggle" onclick="return toggle('Helper.colorObject');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#colorObject">colorObject</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">,</tt><tt class="py-param">color</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">options</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.colorObject-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.colorObject-expanded"><a name="L1067"></a><tt class="py-lineno">1067</tt>  <tt class="py-line">        <tt class="py-docstring">"""Apply the given color to the given object, </tt> </tt>
<a name="L1068"></a><tt class="py-lineno">1068</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L1069"></a><tt class="py-lineno">1069</tt>  <tt class="py-line">        <tt class="py-name">useMaterial</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L1070"></a><tt class="py-lineno">1070</tt>  <tt class="py-line">        <tt class="py-name">useObjectColors</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt>         </tt>
<a name="L1071"></a><tt class="py-lineno">1071</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">"useMaterial"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1072"></a><tt class="py-lineno">1072</tt>  <tt class="py-line">            <tt class="py-name">useMaterial</tt> <tt class="py-op">=</tt> <tt class="py-name">options</tt><tt class="py-op">[</tt><tt class="py-string">"useMaterial"</tt><tt class="py-op">]</tt> </tt>
<a name="L1073"></a><tt class="py-lineno">1073</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">options</tt><tt class="py-op">.</tt><tt class="py-name">has_key</tt><tt class="py-op">(</tt><tt class="py-string">"useObjectColors"</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1074"></a><tt class="py-lineno">1074</tt>  <tt class="py-line">            <tt class="py-name">useObjectColors</tt> <tt class="py-op">=</tt> <tt class="py-name">options</tt><tt class="py-op">[</tt><tt class="py-string">"useObjectColors"</tt><tt class="py-op">]</tt> </tt>
</div><a name="L1075"></a><tt class="py-lineno">1075</tt>  <tt class="py-line">         </tt>
<a name="L1076"></a><tt class="py-lineno">1076</tt>  <tt class="py-line">         </tt>
<a name="Helper.changeColor"></a><div id="Helper.changeColor-def"><a name="L1077"></a><tt class="py-lineno">1077</tt> <a class="py-toggle" href="#" id="Helper.changeColor-toggle" onclick="return toggle('Helper.changeColor');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#changeColor">changeColor</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">,</tt><tt class="py-param">colors</tt><tt class="py-op">,</tt><tt class="py-param">perVertex</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-param">proxyObject</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-param">doc</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">pb</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> </tt>
<a name="L1078"></a><tt class="py-lineno">1078</tt>  <tt class="py-line">                    <tt class="py-param">facesSelection</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">faceMaterial</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.changeColor-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.changeColor-expanded"><a name="L1079"></a><tt class="py-lineno">1079</tt>  <tt class="py-line">        <tt class="py-docstring">"""Apply the given set of color to the given object, </tt> </tt>
<a name="L1080"></a><tt class="py-lineno">1080</tt>  <tt class="py-line"><tt class="py-docstring">        if the object is a mesh this functino handle the color per vertex</tt> </tt>
<a name="L1081"></a><tt class="py-lineno">1081</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1082"></a><tt class="py-lineno">1082</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1083"></a><tt class="py-lineno">1083</tt>  <tt class="py-line">     </tt>
<a name="Helper.changeObjColorMat"></a><div id="Helper.changeObjColorMat-def"><a name="L1084"></a><tt class="py-lineno">1084</tt> <a class="py-toggle" href="#" id="Helper.changeObjColorMat-toggle" onclick="return toggle('Helper.changeObjColorMat');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#changeObjColorMat">changeObjColorMat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">,</tt><tt class="py-param">color</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.changeObjColorMat-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.changeObjColorMat-expanded"><a name="L1085"></a><tt class="py-lineno">1085</tt>  <tt class="py-line">        <tt class="py-docstring">"""change the diffuse color of the object material"""</tt> </tt>
<a name="L1086"></a><tt class="py-lineno">1086</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1087"></a><tt class="py-lineno">1087</tt>  <tt class="py-line"> </tt>
<a name="L1088"></a><tt class="py-lineno">1088</tt>  <tt class="py-line">     </tt>
<a name="Helper.getMesh"></a><div id="Helper.getMesh-def"><a name="L1089"></a><tt class="py-lineno">1089</tt> <a class="py-toggle" href="#" id="Helper.getMesh-toggle" onclick="return toggle('Helper.getMesh');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMesh">getMesh</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMesh-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMesh-expanded"><a name="L1090"></a><tt class="py-lineno">1090</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1091"></a><tt class="py-lineno">1091</tt>  <tt class="py-line"> </tt>
<a name="Helper.getName"></a><div id="Helper.getName-def"><a name="L1092"></a><tt class="py-lineno">1092</tt> <a class="py-toggle" href="#" id="Helper.getName-toggle" onclick="return toggle('Helper.getName');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getName">getName</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getName-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getName-expanded"><a name="L1093"></a><tt class="py-lineno">1093</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1094"></a><tt class="py-lineno">1094</tt>  <tt class="py-line">         </tt>
<a name="Helper.reParent"></a><div id="Helper.reParent-def"><a name="L1095"></a><tt class="py-lineno">1095</tt> <a class="py-toggle" href="#" id="Helper.reParent-toggle" onclick="return toggle('Helper.reParent');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#reParent">reParent</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">objs</tt><tt class="py-op">,</tt><tt class="py-param">parent</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.reParent-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.reParent-expanded"><a name="L1096"></a><tt class="py-lineno">1096</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1097"></a><tt class="py-lineno">1097</tt>  <tt class="py-line"><tt class="py-docstring">        Change the object parent using the specified parent objects</tt> </tt>
<a name="L1098"></a><tt class="py-lineno">1098</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1099"></a><tt class="py-lineno">1099</tt>  <tt class="py-line"><tt class="py-docstring">        @type  objs: hostObject</tt> </tt>
<a name="L1100"></a><tt class="py-lineno">1100</tt>  <tt class="py-line"><tt class="py-docstring">        @param objs: the object to be reparented</tt> </tt>
<a name="L1101"></a><tt class="py-lineno">1101</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parent: hostObject</tt> </tt>
<a name="L1102"></a><tt class="py-lineno">1102</tt>  <tt class="py-line"><tt class="py-docstring">        @param parent: the new parent object</tt> </tt>
<a name="L1103"></a><tt class="py-lineno">1103</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1104"></a><tt class="py-lineno">1104</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1105"></a><tt class="py-lineno">1105</tt>  <tt class="py-line"> </tt>
<a name="L1106"></a><tt class="py-lineno">1106</tt>  <tt class="py-line"> </tt>
<a name="Helper.deleteChildrens"></a><div id="Helper.deleteChildrens-def"><a name="L1107"></a><tt class="py-lineno">1107</tt> <a class="py-toggle" href="#" id="Helper.deleteChildrens-toggle" onclick="return toggle('Helper.deleteChildrens');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#deleteChildrens">deleteChildrens</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.deleteChildrens-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.deleteChildrens-expanded"><a name="L1108"></a><tt class="py-lineno">1108</tt>  <tt class="py-line">        <tt class="py-comment">#recursively delete childrenobject</tt> </tt>
<a name="L1109"></a><tt class="py-lineno">1109</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">childs</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">getChilds</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">)</tt> </tt>
<a name="L1110"></a><tt class="py-lineno">1110</tt>  <tt class="py-line"><tt class="py-comment">#        print childs</tt> </tt>
<a name="L1111"></a><tt class="py-lineno">1111</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">childs</tt> <tt class="py-op">:</tt> </tt>
<a name="L1112"></a><tt class="py-lineno">1112</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">childs</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">list</tt> <tt class="py-keyword">or</tt> <tt class="py-name">type</tt><tt class="py-op">(</tt><tt class="py-name">childs</tt><tt class="py-op">)</tt> <tt class="py-keyword">is</tt> <tt class="py-name">tuple</tt><tt class="py-op">:</tt> </tt>
<a name="L1113"></a><tt class="py-lineno">1113</tt>  <tt class="py-line">                <tt class="py-op">[</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-65" class="py-name" targets="Method upy.hostHelper.Helper.deleteChildrens()=upy.hostHelper.Helper-class.html#deleteChildrens"><a title="upy.hostHelper.Helper.deleteChildrens" class="py-name" href="#" onclick="return doclink('link-65', 'deleteChildrens', 'link-65');">deleteChildrens</a></tt><tt class="py-op">(</tt><tt class="py-name">ch</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">ch</tt> <tt class="py-keyword">in</tt> <tt class="py-name">childs</tt><tt class="py-op">]</tt> </tt>
<a name="L1114"></a><tt class="py-lineno">1114</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1115"></a><tt class="py-lineno">1115</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-66" class="py-name"><a title="upy.hostHelper.Helper.deleteChildrens" class="py-name" href="#" onclick="return doclink('link-66', 'deleteChildrens', 'link-65');">deleteChildrens</a></tt><tt class="py-op">(</tt><tt class="py-name">childs</tt><tt class="py-op">)</tt> </tt>
<a name="L1116"></a><tt class="py-lineno">1116</tt>  <tt class="py-line"><tt class="py-comment">#        else :</tt> </tt>
<a name="L1117"></a><tt class="py-lineno">1117</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">deleteObject</tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1118"></a><tt class="py-lineno">1118</tt>  <tt class="py-line"> </tt>
<a name="Helper.constraintLookAt"></a><div id="Helper.constraintLookAt-def"><a name="L1119"></a><tt class="py-lineno">1119</tt> <a class="py-toggle" href="#" id="Helper.constraintLookAt-toggle" onclick="return toggle('Helper.constraintLookAt');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#constraintLookAt">constraintLookAt</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.constraintLookAt-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.constraintLookAt-expanded"><a name="L1120"></a><tt class="py-lineno">1120</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1121"></a><tt class="py-lineno">1121</tt>  <tt class="py-line"><tt class="py-docstring">        Cosntraint an hostobject to llok at the camera</tt> </tt>
<a name="L1122"></a><tt class="py-lineno">1122</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1123"></a><tt class="py-lineno">1123</tt>  <tt class="py-line"><tt class="py-docstring">        @type  object: Hostobject</tt> </tt>
<a name="L1124"></a><tt class="py-lineno">1124</tt>  <tt class="py-line"><tt class="py-docstring">        @param object: object to constraint</tt> </tt>
<a name="L1125"></a><tt class="py-lineno">1125</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1126"></a><tt class="py-lineno">1126</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1127"></a><tt class="py-lineno">1127</tt>  <tt class="py-line"> </tt>
<a name="L1128"></a><tt class="py-lineno">1128</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L1129"></a><tt class="py-lineno">1129</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#     Basic object</tt> </tt>
<a name="L1130"></a><tt class="py-lineno">1130</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="Helper.Text"></a><div id="Helper.Text-def"><a name="L1131"></a><tt class="py-lineno">1131</tt> <a class="py-toggle" href="#" id="Helper.Text-toggle" onclick="return toggle('Helper.Text');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Text">Text</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">,</tt><tt class="py-param">string</tt><tt class="py-op">=</tt><tt class="py-string">""</tt><tt class="py-op">,</tt><tt class="py-param">parent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-number">5.</tt><tt class="py-op">,</tt><tt class="py-param">pos</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">font</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">lookAt</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Text-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Text-expanded"><a name="L1132"></a><tt class="py-lineno">1132</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1133"></a><tt class="py-lineno">1133</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type Text.</tt> </tt>
<a name="L1134"></a><tt class="py-lineno">1134</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1135"></a><tt class="py-lineno">1135</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1136"></a><tt class="py-lineno">1136</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the circle</tt> </tt>
<a name="L1137"></a><tt class="py-lineno">1137</tt>  <tt class="py-line"><tt class="py-docstring">        @type  string: string</tt> </tt>
<a name="L1138"></a><tt class="py-lineno">1138</tt>  <tt class="py-line"><tt class="py-docstring">        @param string: text to display</tt> </tt>
<a name="L1139"></a><tt class="py-lineno">1139</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parent: Hostobject</tt> </tt>
<a name="L1140"></a><tt class="py-lineno">1140</tt>  <tt class="py-line"><tt class="py-docstring">        @param parent: parent of the text</tt> </tt>
<a name="L1141"></a><tt class="py-lineno">1141</tt>  <tt class="py-line"><tt class="py-docstring">        @type  size: Float</tt> </tt>
<a name="L1142"></a><tt class="py-lineno">1142</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: height of the text</tt> </tt>
<a name="L1143"></a><tt class="py-lineno">1143</tt>  <tt class="py-line"><tt class="py-docstring">        @type  pos: Vector</tt> </tt>
<a name="L1144"></a><tt class="py-lineno">1144</tt>  <tt class="py-line"><tt class="py-docstring">        @param pos: position of the text</tt> </tt>
<a name="L1145"></a><tt class="py-lineno">1145</tt>  <tt class="py-line"><tt class="py-docstring">        @type  font: ?</tt> </tt>
<a name="L1146"></a><tt class="py-lineno">1146</tt>  <tt class="py-line"><tt class="py-docstring">        @param font: the font to use</tt> </tt>
<a name="L1147"></a><tt class="py-lineno">1147</tt>  <tt class="py-line"><tt class="py-docstring">        @type  lookAt: boolean</tt> </tt>
<a name="L1148"></a><tt class="py-lineno">1148</tt>  <tt class="py-line"><tt class="py-docstring">        @param lookAt: either the text  is constraint to look at the camera/view</tt> </tt>
<a name="L1149"></a><tt class="py-lineno">1149</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1150"></a><tt class="py-lineno">1150</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1151"></a><tt class="py-lineno">1151</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created text object</tt> </tt>
<a name="L1152"></a><tt class="py-lineno">1152</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1153"></a><tt class="py-lineno">1153</tt>  <tt class="py-line">        <tt class="py-name">text</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L1154"></a><tt class="py-lineno">1154</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">text</tt> </tt>
</div><a name="L1155"></a><tt class="py-lineno">1155</tt>  <tt class="py-line">         </tt>
<a name="Helper.Circle"></a><div id="Helper.Circle-def"><a name="L1156"></a><tt class="py-lineno">1156</tt> <a class="py-toggle" href="#" id="Helper.Circle-toggle" onclick="return toggle('Helper.Circle');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Circle">Circle</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">rad</tt><tt class="py-op">=</tt><tt class="py-number">1.</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Circle-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Circle-expanded"><a name="L1157"></a><tt class="py-lineno">1157</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1158"></a><tt class="py-lineno">1158</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type 2d circle.</tt> </tt>
<a name="L1159"></a><tt class="py-lineno">1159</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1160"></a><tt class="py-lineno">1160</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1161"></a><tt class="py-lineno">1161</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the circle</tt> </tt>
<a name="L1162"></a><tt class="py-lineno">1162</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rad: float</tt> </tt>
<a name="L1163"></a><tt class="py-lineno">1163</tt>  <tt class="py-line"><tt class="py-docstring">        @param rad: the radius of the cylinder (default = 1.)</tt> </tt>
<a name="L1164"></a><tt class="py-lineno">1164</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1165"></a><tt class="py-lineno">1165</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1166"></a><tt class="py-lineno">1166</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created circle</tt> </tt>
<a name="L1167"></a><tt class="py-lineno">1167</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1168"></a><tt class="py-lineno">1168</tt>  <tt class="py-line">        <tt class="py-comment">#put the apropriate code here</tt> </tt>
<a name="L1169"></a><tt class="py-lineno">1169</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">circle</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L1170"></a><tt class="py-lineno">1170</tt>  <tt class="py-line">        <tt class="py-comment">#set name and rad for the circle</tt> </tt>
<a name="L1171"></a><tt class="py-lineno">1171</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">circle</tt> </tt>
</div><a name="L1172"></a><tt class="py-lineno">1172</tt>  <tt class="py-line">     </tt>
<a name="Helper.Cylinder"></a><div id="Helper.Cylinder-def"><a name="L1173"></a><tt class="py-lineno">1173</tt> <a class="py-toggle" href="#" id="Helper.Cylinder-toggle" onclick="return toggle('Helper.Cylinder');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Cylinder">Cylinder</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">=</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-param">length</tt><tt class="py-op">=</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-param">res</tt><tt class="py-op">=</tt><tt class="py-number">16</tt><tt class="py-op">,</tt> <tt class="py-param">pos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Cylinder-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Cylinder-expanded"><a name="L1174"></a><tt class="py-lineno">1174</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1175"></a><tt class="py-lineno">1175</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type cylinder.</tt> </tt>
<a name="L1176"></a><tt class="py-lineno">1176</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1177"></a><tt class="py-lineno">1177</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1178"></a><tt class="py-lineno">1178</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the cylinder</tt> </tt>
<a name="L1179"></a><tt class="py-lineno">1179</tt>  <tt class="py-line"><tt class="py-docstring">        @type  radius: float</tt> </tt>
<a name="L1180"></a><tt class="py-lineno">1180</tt>  <tt class="py-line"><tt class="py-docstring">        @param radius: the radius of the cylinder</tt> </tt>
<a name="L1181"></a><tt class="py-lineno">1181</tt>  <tt class="py-line"><tt class="py-docstring">        @type  length: float</tt> </tt>
<a name="L1182"></a><tt class="py-lineno">1182</tt>  <tt class="py-line"><tt class="py-docstring">        @param length: the length of the cylinder</tt> </tt>
<a name="L1183"></a><tt class="py-lineno">1183</tt>  <tt class="py-line"><tt class="py-docstring">        @type  res: float</tt> </tt>
<a name="L1184"></a><tt class="py-lineno">1184</tt>  <tt class="py-line"><tt class="py-docstring">        @param res: the resolution/quality of the cylinder</tt> </tt>
<a name="L1185"></a><tt class="py-lineno">1185</tt>  <tt class="py-line"><tt class="py-docstring">        @type  pos: array</tt> </tt>
<a name="L1186"></a><tt class="py-lineno">1186</tt>  <tt class="py-line"><tt class="py-docstring">        @param pos: the position of the cylinder</tt> </tt>
<a name="L1187"></a><tt class="py-lineno">1187</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1188"></a><tt class="py-lineno">1188</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1189"></a><tt class="py-lineno">1189</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created cylinder</tt> </tt>
<a name="L1190"></a><tt class="py-lineno">1190</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1191"></a><tt class="py-lineno">1191</tt>  <tt class="py-line">     </tt>
<a name="L1192"></a><tt class="py-lineno">1192</tt>  <tt class="py-line">        <tt class="py-name">baseCyl</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> <tt class="py-comment">#use the hostAPI</tt> </tt>
<a name="L1193"></a><tt class="py-lineno">1193</tt>  <tt class="py-line">    <tt class="py-comment">#    baseCyl radius = radius</tt> </tt>
<a name="L1194"></a><tt class="py-lineno">1194</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    baseCyl length = length</tt> </tt>
<a name="L1195"></a><tt class="py-lineno">1195</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    baseCyl resolution = res</tt> </tt>
<a name="L1196"></a><tt class="py-lineno">1196</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">baseCyl</tt> </tt>
</div><a name="L1197"></a><tt class="py-lineno">1197</tt>  <tt class="py-line">                 </tt>
<a name="Helper.Sphere"></a><div id="Helper.Sphere-def"><a name="L1198"></a><tt class="py-lineno">1198</tt> <a class="py-toggle" href="#" id="Helper.Sphere-toggle" onclick="return toggle('Helper.Sphere');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Sphere">Sphere</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">=</tt><tt class="py-number">1.0</tt><tt class="py-op">,</tt><tt class="py-param">res</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-param">pos</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Sphere-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Sphere-expanded"><a name="L1199"></a><tt class="py-lineno">1199</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1200"></a><tt class="py-lineno">1200</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type sphere.</tt> </tt>
<a name="L1201"></a><tt class="py-lineno">1201</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1202"></a><tt class="py-lineno">1202</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1203"></a><tt class="py-lineno">1203</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the sphere</tt> </tt>
<a name="L1204"></a><tt class="py-lineno">1204</tt>  <tt class="py-line"><tt class="py-docstring">        @type  radius: float</tt> </tt>
<a name="L1205"></a><tt class="py-lineno">1205</tt>  <tt class="py-line"><tt class="py-docstring">        @param radius: the radius of the sphere</tt> </tt>
<a name="L1206"></a><tt class="py-lineno">1206</tt>  <tt class="py-line"><tt class="py-docstring">        @type  res: float</tt> </tt>
<a name="L1207"></a><tt class="py-lineno">1207</tt>  <tt class="py-line"><tt class="py-docstring">        @param res: the resolution/quality of the sphere</tt> </tt>
<a name="L1208"></a><tt class="py-lineno">1208</tt>  <tt class="py-line"><tt class="py-docstring">        @type  pos: array</tt> </tt>
<a name="L1209"></a><tt class="py-lineno">1209</tt>  <tt class="py-line"><tt class="py-docstring">        @param pos: the position of the cylinder</tt> </tt>
<a name="L1210"></a><tt class="py-lineno">1210</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1211"></a><tt class="py-lineno">1211</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1212"></a><tt class="py-lineno">1212</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created sphere</tt> </tt>
<a name="L1213"></a><tt class="py-lineno">1213</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1214"></a><tt class="py-lineno">1214</tt>  <tt class="py-line">     </tt>
<a name="L1215"></a><tt class="py-lineno">1215</tt>  <tt class="py-line">        <tt class="py-name">QualitySph</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">"0"</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-string">"1"</tt><tt class="py-op">:</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-string">"2"</tt><tt class="py-op">:</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-string">"3"</tt><tt class="py-op">:</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-string">"4"</tt><tt class="py-op">:</tt><tt class="py-number">8</tt><tt class="py-op">,</tt><tt class="py-string">"5"</tt><tt class="py-op">:</tt><tt class="py-number">16</tt><tt class="py-op">}</tt>  </tt>
<a name="L1216"></a><tt class="py-lineno">1216</tt>  <tt class="py-line">        <tt class="py-name">baseSphere</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-comment">#c4d.BaseObject(c4d.Osphere)</tt> </tt>
<a name="L1217"></a><tt class="py-lineno">1217</tt>  <tt class="py-line">    <tt class="py-comment">#    baseSphere radius = radius</tt> </tt>
<a name="L1218"></a><tt class="py-lineno">1218</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    baseSphere resolution = QualitySph[str(res)]</tt> </tt>
<a name="L1219"></a><tt class="py-lineno">1219</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    baseSphere position = position</tt> </tt>
<a name="L1220"></a><tt class="py-lineno">1220</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">baseSphere</tt> </tt>
</div><a name="L1221"></a><tt class="py-lineno">1221</tt>  <tt class="py-line">         </tt>
<a name="Helper.box"></a><div id="Helper.box-def"><a name="L1222"></a><tt class="py-lineno">1222</tt> <a class="py-toggle" href="#" id="Helper.box-toggle" onclick="return toggle('Helper.box');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#box">box</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">center</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-number">1.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">cornerPoints</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">visible</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.box-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.box-expanded"><a name="L1223"></a><tt class="py-lineno">1223</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1224"></a><tt class="py-lineno">1224</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type cube.</tt> </tt>
<a name="L1225"></a><tt class="py-lineno">1225</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1226"></a><tt class="py-lineno">1226</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1227"></a><tt class="py-lineno">1227</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the box</tt> </tt>
<a name="L1228"></a><tt class="py-lineno">1228</tt>  <tt class="py-line"><tt class="py-docstring">        @type  center: array</tt> </tt>
<a name="L1229"></a><tt class="py-lineno">1229</tt>  <tt class="py-line"><tt class="py-docstring">        @param center: the center of the box</tt> </tt>
<a name="L1230"></a><tt class="py-lineno">1230</tt>  <tt class="py-line"><tt class="py-docstring">        @type  size: array</tt> </tt>
<a name="L1231"></a><tt class="py-lineno">1231</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: the size in x y z direction</tt> </tt>
<a name="L1232"></a><tt class="py-lineno">1232</tt>  <tt class="py-line"><tt class="py-docstring">        @type  cornerPoints: array list</tt> </tt>
<a name="L1233"></a><tt class="py-lineno">1233</tt>  <tt class="py-line"><tt class="py-docstring">        @param cornerPoints: the upper-left and bottom right corner point coordinates</tt> </tt>
<a name="L1234"></a><tt class="py-lineno">1234</tt>  <tt class="py-line"><tt class="py-docstring">        @type  visible: booelan</tt> </tt>
<a name="L1235"></a><tt class="py-lineno">1235</tt>  <tt class="py-line"><tt class="py-docstring">        @param visible: visibility of the cube after creation (deprecated)</tt> </tt>
<a name="L1236"></a><tt class="py-lineno">1236</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1237"></a><tt class="py-lineno">1237</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1238"></a><tt class="py-lineno">1238</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created box</tt> </tt>
<a name="L1239"></a><tt class="py-lineno">1239</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1240"></a><tt class="py-lineno">1240</tt>  <tt class="py-line">        <tt class="py-comment">#put your code</tt> </tt>
<a name="L1241"></a><tt class="py-lineno">1241</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-67" class="py-name" targets="Method upy.hostHelper.Helper.box()=upy.hostHelper.Helper-class.html#box"><a title="upy.hostHelper.Helper.box" class="py-name" href="#" onclick="return doclink('link-67', 'box', 'link-67');">box</a></tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L1242"></a><tt class="py-lineno">1242</tt>  <tt class="py-line">        <tt class="py-comment">#set the name 'name'</tt> </tt>
<a name="L1243"></a><tt class="py-lineno">1243</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#if corner is provided compute the cube dimension in x,y,z, and the center</tt> </tt>
<a name="L1244"></a><tt class="py-lineno">1244</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">cornerPoints</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L1245"></a><tt class="py-lineno">1245</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1246"></a><tt class="py-lineno">1246</tt>  <tt class="py-line">                <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L1247"></a><tt class="py-lineno">1247</tt>  <tt class="py-line">            <tt class="py-name">center</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt> </tt>
<a name="L1248"></a><tt class="py-lineno">1248</tt>  <tt class="py-line">        <tt class="py-comment">#position the cube to center</tt> </tt>
<a name="L1249"></a><tt class="py-lineno">1249</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#set the dimension to size</tt> </tt>
<a name="L1250"></a><tt class="py-lineno">1250</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#return the box</tt> </tt>
<a name="L1251"></a><tt class="py-lineno">1251</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt id="link-68" class="py-name"><a title="upy.hostHelper.Helper.box" class="py-name" href="#" onclick="return doclink('link-68', 'box', 'link-67');">box</a></tt> </tt>
</div><a name="L1252"></a><tt class="py-lineno">1252</tt>  <tt class="py-line"> </tt>
<a name="Helper.updateBox"></a><div id="Helper.updateBox-def"><a name="L1253"></a><tt class="py-lineno">1253</tt> <a class="py-toggle" href="#" id="Helper.updateBox-toggle" onclick="return toggle('Helper.updateBox');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#updateBox">updateBox</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">box</tt><tt class="py-op">,</tt><tt class="py-param">center</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-number">1.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">cornerPoints</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L1254"></a><tt class="py-lineno">1254</tt>  <tt class="py-line">                    <tt class="py-param">visible</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-param">mat</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.updateBox-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.updateBox-expanded"><a name="L1255"></a><tt class="py-lineno">1255</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1256"></a><tt class="py-lineno">1256</tt>  <tt class="py-line"><tt class="py-docstring">        Update the given box.</tt> </tt>
<a name="L1257"></a><tt class="py-lineno">1257</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1258"></a><tt class="py-lineno">1258</tt>  <tt class="py-line"><tt class="py-docstring">        @type  box: string </tt> </tt>
<a name="L1259"></a><tt class="py-lineno">1259</tt>  <tt class="py-line"><tt class="py-docstring">        @param box: name of the box</tt> </tt>
<a name="L1260"></a><tt class="py-lineno">1260</tt>  <tt class="py-line"><tt class="py-docstring">        @type  center: array</tt> </tt>
<a name="L1261"></a><tt class="py-lineno">1261</tt>  <tt class="py-line"><tt class="py-docstring">        @param center: the new center of the box</tt> </tt>
<a name="L1262"></a><tt class="py-lineno">1262</tt>  <tt class="py-line"><tt class="py-docstring">        @type  size: array</tt> </tt>
<a name="L1263"></a><tt class="py-lineno">1263</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: the new size in x y z direction</tt> </tt>
<a name="L1264"></a><tt class="py-lineno">1264</tt>  <tt class="py-line"><tt class="py-docstring">        @type  cornerPoints: array list</tt> </tt>
<a name="L1265"></a><tt class="py-lineno">1265</tt>  <tt class="py-line"><tt class="py-docstring">        @param cornerPoints: the new upper-left and bottom right corner point coordinates</tt> </tt>
<a name="L1266"></a><tt class="py-lineno">1266</tt>  <tt class="py-line"><tt class="py-docstring">        @type  visible: booelan</tt> </tt>
<a name="L1267"></a><tt class="py-lineno">1267</tt>  <tt class="py-line"><tt class="py-docstring">        @param visible: visibility of the cube after creation (deprecated)</tt> </tt>
<a name="L1268"></a><tt class="py-lineno">1268</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L1269"></a><tt class="py-lineno">1269</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1270"></a><tt class="py-lineno">1270</tt>  <tt class="py-line">        <tt class="py-comment">#put your code</tt> </tt>
<a name="L1271"></a><tt class="py-lineno">1271</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-69" class="py-name"><a title="upy.hostHelper.Helper.box" class="py-name" href="#" onclick="return doclink('link-69', 'box', 'link-67');">box</a></tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L1272"></a><tt class="py-lineno">1272</tt>  <tt class="py-line">        <tt class="py-comment">#set the name 'name'</tt> </tt>
<a name="L1273"></a><tt class="py-lineno">1273</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#if corner is provided compute the cube dimension in x,y,z, and the center</tt> </tt>
<a name="L1274"></a><tt class="py-lineno">1274</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">cornerPoints</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L1275"></a><tt class="py-lineno">1275</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1276"></a><tt class="py-lineno">1276</tt>  <tt class="py-line">                <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L1277"></a><tt class="py-lineno">1277</tt>  <tt class="py-line">            <tt class="py-name">center</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt> </tt>
</div><a name="L1278"></a><tt class="py-lineno">1278</tt>  <tt class="py-line">        <tt class="py-comment">#position the cube to center</tt> </tt>
<a name="L1279"></a><tt class="py-lineno">1279</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#set the dimension to size</tt> </tt>
<a name="L1280"></a><tt class="py-lineno">1280</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="Helper.getCornerPointCube"></a><div id="Helper.getCornerPointCube-def"><a name="L1281"></a><tt class="py-lineno">1281</tt> <a class="py-toggle" href="#" id="Helper.getCornerPointCube-toggle" onclick="return toggle('Helper.getCornerPointCube');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getCornerPointCube">getCornerPointCube</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">obj</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getCornerPointCube-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getCornerPointCube-expanded"><a name="L1282"></a><tt class="py-lineno">1282</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1283"></a><tt class="py-lineno">1283</tt>  <tt class="py-line"><tt class="py-docstring">        Return the corner Point of the Given Cube/Box</tt> </tt>
<a name="L1284"></a><tt class="py-lineno">1284</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1285"></a><tt class="py-lineno">1285</tt>  <tt class="py-line"><tt class="py-docstring">        @type  obj: string</tt> </tt>
<a name="L1286"></a><tt class="py-lineno">1286</tt>  <tt class="py-line"><tt class="py-docstring">        @param obj: name of the box</tt> </tt>
<a name="L1287"></a><tt class="py-lineno">1287</tt>  <tt class="py-line"><tt class="py-docstring">         </tt> </tt>
<a name="L1288"></a><tt class="py-lineno">1288</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   array 2x3</tt> </tt>
<a name="L1289"></a><tt class="py-lineno">1289</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the upper-left and bottom right corner point coordinates</tt> </tt>
<a name="L1290"></a><tt class="py-lineno">1290</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1291"></a><tt class="py-lineno">1291</tt>  <tt class="py-line">         </tt>
<a name="L1292"></a><tt class="py-lineno">1292</tt>  <tt class="py-line">        <tt class="py-name">size</tt> <tt class="py-op">=</tt> <tt class="py-name">obj</tt><tt class="py-op">[</tt><tt class="py-number">1100</tt><tt class="py-op">]</tt> </tt>
<a name="L1293"></a><tt class="py-lineno">1293</tt>  <tt class="py-line">        <tt class="py-name">center</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-70" class="py-name" targets="Method upy.hostHelper.Helper.getTranslation()=upy.hostHelper.Helper-class.html#getTranslation"><a title="upy.hostHelper.Helper.getTranslation" class="py-name" href="#" onclick="return doclink('link-70', 'getTranslation', 'link-70');">getTranslation</a></tt><tt class="py-op">(</tt><tt class="py-name">obj</tt><tt class="py-op">)</tt> </tt>
<a name="L1294"></a><tt class="py-lineno">1294</tt>  <tt class="py-line">        <tt class="py-name">cornerPoints</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1295"></a><tt class="py-lineno">1295</tt>  <tt class="py-line">        <tt class="py-comment">#lowCorner</tt> </tt>
<a name="L1296"></a><tt class="py-lineno">1296</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">lc</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">,</tt> </tt>
<a name="L1297"></a><tt class="py-lineno">1297</tt>  <tt class="py-line">              <tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">,</tt> </tt>
<a name="L1298"></a><tt class="py-lineno">1298</tt>  <tt class="py-line">              <tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">]</tt> </tt>
<a name="L1299"></a><tt class="py-lineno">1299</tt>  <tt class="py-line">        <tt class="py-comment">#upperCorner</tt> </tt>
<a name="L1300"></a><tt class="py-lineno">1300</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">uc</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">,</tt> </tt>
<a name="L1301"></a><tt class="py-lineno">1301</tt>  <tt class="py-line">              <tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">,</tt> </tt>
<a name="L1302"></a><tt class="py-lineno">1302</tt>  <tt class="py-line">              <tt class="py-name">center</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt><tt class="py-op">]</tt> </tt>
<a name="L1303"></a><tt class="py-lineno">1303</tt>  <tt class="py-line">        <tt class="py-name">cornerPoints</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-name">lc</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">lc</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">lc</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-name">uc</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">uc</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">uc</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1304"></a><tt class="py-lineno">1304</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">cornerPoints</tt> </tt>
</div><a name="L1305"></a><tt class="py-lineno">1305</tt>  <tt class="py-line">         </tt>
<a name="Helper.spline"></a><div id="Helper.spline-def"><a name="L1306"></a><tt class="py-lineno">1306</tt> <a class="py-toggle" href="#" id="Helper.spline-toggle" onclick="return toggle('Helper.spline');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#spline">spline</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt> <tt class="py-param">points</tt><tt class="py-op">,</tt><tt class="py-param">close</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-param">type</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-param">scene</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">parent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.spline-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.spline-expanded"><a name="L1307"></a><tt class="py-lineno">1307</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1308"></a><tt class="py-lineno">1308</tt>  <tt class="py-line"><tt class="py-docstring">        This will return a hostApp spline/curve object according the given list</tt> </tt>
<a name="L1309"></a><tt class="py-lineno">1309</tt>  <tt class="py-line"><tt class="py-docstring">        of point.</tt> </tt>
<a name="L1310"></a><tt class="py-lineno">1310</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1311"></a><tt class="py-lineno">1311</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1312"></a><tt class="py-lineno">1312</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the object</tt> </tt>
<a name="L1313"></a><tt class="py-lineno">1313</tt>  <tt class="py-line"><tt class="py-docstring">        @type  points: liste/array vector</tt> </tt>
<a name="L1314"></a><tt class="py-lineno">1314</tt>  <tt class="py-line"><tt class="py-docstring">        @param points: list of position coordinate of the curve point</tt> </tt>
<a name="L1315"></a><tt class="py-lineno">1315</tt>  <tt class="py-line"><tt class="py-docstring">        @type  close: bool/int</tt> </tt>
<a name="L1316"></a><tt class="py-lineno">1316</tt>  <tt class="py-line"><tt class="py-docstring">        @param close: is the curve is closed</tt> </tt>
<a name="L1317"></a><tt class="py-lineno">1317</tt>  <tt class="py-line"><tt class="py-docstring">        @type  type: int/string</tt> </tt>
<a name="L1318"></a><tt class="py-lineno">1318</tt>  <tt class="py-line"><tt class="py-docstring">        @param type: ususally describe type of curve, ie : bezier, linear, cubic, etc...</tt> </tt>
<a name="L1319"></a><tt class="py-lineno">1319</tt>  <tt class="py-line"><tt class="py-docstring">        @type  scene: hostApp scene</tt> </tt>
<a name="L1320"></a><tt class="py-lineno">1320</tt>  <tt class="py-line"><tt class="py-docstring">        @param scene: the current scene</tt> </tt>
<a name="L1321"></a><tt class="py-lineno">1321</tt>  <tt class="py-line"><tt class="py-docstring">        @type  parent: hostObject</tt> </tt>
<a name="L1322"></a><tt class="py-lineno">1322</tt>  <tt class="py-line"><tt class="py-docstring">        @param parent: the parent for the curve</tt> </tt>
<a name="L1323"></a><tt class="py-lineno">1323</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L1324"></a><tt class="py-lineno">1324</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1325"></a><tt class="py-lineno">1325</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created spline</tt> </tt>
<a name="L1326"></a><tt class="py-lineno">1326</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1327"></a><tt class="py-lineno">1327</tt>  <tt class="py-line">        <tt class="py-comment">#create the spline</tt> </tt>
<a name="L1328"></a><tt class="py-lineno">1328</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-71" class="py-name" targets="Method upy.hostHelper.Helper.spline()=upy.hostHelper.Helper-class.html#spline"><a title="upy.hostHelper.Helper.spline" class="py-name" href="#" onclick="return doclink('link-71', 'spline', 'link-71');">spline</a></tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L1329"></a><tt class="py-lineno">1329</tt>  <tt class="py-line">        <tt class="py-comment">#define type, close, name</tt> </tt>
<a name="L1330"></a><tt class="py-lineno">1330</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#set the points</tt> </tt>
<a name="L1331"></a><tt class="py-lineno">1331</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">p</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">points</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1332"></a><tt class="py-lineno">1332</tt>  <tt class="py-line">            <tt class="py-comment">#set every i point</tt> </tt>
<a name="L1333"></a><tt class="py-lineno">1333</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">pass</tt>  </tt>
<a name="L1334"></a><tt class="py-lineno">1334</tt>  <tt class="py-line">        <tt class="py-comment">#add the object to the scene</tt> </tt>
<a name="L1335"></a><tt class="py-lineno">1335</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">scene</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L1336"></a><tt class="py-lineno">1336</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-72" class="py-name"><a title="upy.hostHelper.Helper.addObjectToScene" class="py-name" href="#" onclick="return doclink('link-72', 'addObjectToScene', 'link-44');">addObjectToScene</a></tt><tt class="py-op">(</tt><tt class="py-name">scene</tt><tt class="py-op">,</tt><tt id="link-73" class="py-name"><a title="upy.hostHelper.Helper.spline" class="py-name" href="#" onclick="return doclink('link-73', 'spline', 'link-71');">spline</a></tt><tt class="py-op">,</tt><tt class="py-name">parent</tt><tt class="py-op">=</tt><tt class="py-name">parent</tt><tt class="py-op">)</tt> </tt>
<a name="L1337"></a><tt class="py-lineno">1337</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt id="link-74" class="py-name"><a title="upy.hostHelper.Helper.spline" class="py-name" href="#" onclick="return doclink('link-74', 'spline', 'link-71');">spline</a></tt><tt class="py-op">,</tt><tt class="py-name">None</tt> </tt>
</div><a name="L1338"></a><tt class="py-lineno">1338</tt>  <tt class="py-line"> </tt>
<a name="Helper.plane"></a><div id="Helper.plane-def"><a name="L1339"></a><tt class="py-lineno">1339</tt> <a class="py-toggle" href="#" id="Helper.plane-toggle" onclick="return toggle('Helper.plane');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#plane">plane</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">center</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">size</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">1.</tt><tt class="py-op">,</tt><tt class="py-number">1.</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">cornerPoints</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">visible</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.plane-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.plane-expanded"><a name="L1340"></a><tt class="py-lineno">1340</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1341"></a><tt class="py-lineno">1341</tt>  <tt class="py-line"><tt class="py-docstring">        Create a hostobject of type cube.</tt> </tt>
<a name="L1342"></a><tt class="py-lineno">1342</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1343"></a><tt class="py-lineno">1343</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1344"></a><tt class="py-lineno">1344</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the plane</tt> </tt>
<a name="L1345"></a><tt class="py-lineno">1345</tt>  <tt class="py-line"><tt class="py-docstring">        @type  center: array</tt> </tt>
<a name="L1346"></a><tt class="py-lineno">1346</tt>  <tt class="py-line"><tt class="py-docstring">        @param center: the center of the plane</tt> </tt>
<a name="L1347"></a><tt class="py-lineno">1347</tt>  <tt class="py-line"><tt class="py-docstring">        @type  size: array</tt> </tt>
<a name="L1348"></a><tt class="py-lineno">1348</tt>  <tt class="py-line"><tt class="py-docstring">        @param size: the size in x y z direction</tt> </tt>
<a name="L1349"></a><tt class="py-lineno">1349</tt>  <tt class="py-line"><tt class="py-docstring">        @type  cornerPoints: array list</tt> </tt>
<a name="L1350"></a><tt class="py-lineno">1350</tt>  <tt class="py-line"><tt class="py-docstring">        @param cornerPoints: the upper-left and bottom right corner point coordinates</tt> </tt>
<a name="L1351"></a><tt class="py-lineno">1351</tt>  <tt class="py-line"><tt class="py-docstring">        @type  visible: booelan</tt> </tt>
<a name="L1352"></a><tt class="py-lineno">1352</tt>  <tt class="py-line"><tt class="py-docstring">        @param visible: visibility of the plane after creation (deprecated)</tt> </tt>
<a name="L1353"></a><tt class="py-lineno">1353</tt>  <tt class="py-line"><tt class="py-docstring">        @type  kw: dictionary</tt> </tt>
<a name="L1354"></a><tt class="py-lineno">1354</tt>  <tt class="py-line"><tt class="py-docstring">        @param kw: list of additional arguments : "material", subdivision", axis"</tt> </tt>
<a name="L1355"></a><tt class="py-lineno">1355</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1356"></a><tt class="py-lineno">1356</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1357"></a><tt class="py-lineno">1357</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created plane</tt> </tt>
<a name="L1358"></a><tt class="py-lineno">1358</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>     </tt>
<a name="L1359"></a><tt class="py-lineno">1359</tt>  <tt class="py-line">        <tt class="py-comment">#put your code</tt> </tt>
<a name="L1360"></a><tt class="py-lineno">1360</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt id="link-75" class="py-name" targets="Method upy.hostHelper.Helper.plane()=upy.hostHelper.Helper-class.html#plane"><a title="upy.hostHelper.Helper.plane" class="py-name" href="#" onclick="return doclink('link-75', 'plane', 'link-75');">plane</a></tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L1361"></a><tt class="py-lineno">1361</tt>  <tt class="py-line">        <tt class="py-comment">#set the name 'name'</tt> </tt>
<a name="L1362"></a><tt class="py-lineno">1362</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#if corner is provided compute the cube dimension in x,y,z, and the center</tt> </tt>
<a name="L1363"></a><tt class="py-lineno">1363</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">cornerPoints</tt> <tt class="py-op">!=</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L1364"></a><tt class="py-lineno">1364</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1365"></a><tt class="py-lineno">1365</tt>  <tt class="py-line">                <tt class="py-name">size</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L1366"></a><tt class="py-lineno">1366</tt>  <tt class="py-line">            <tt class="py-name">center</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">cornerPoints</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">2.</tt> </tt>
<a name="L1367"></a><tt class="py-lineno">1367</tt>  <tt class="py-line">        <tt class="py-comment">#position the cube to center</tt> </tt>
<a name="L1368"></a><tt class="py-lineno">1368</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#set the dimension to size</tt> </tt>
<a name="L1369"></a><tt class="py-lineno">1369</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#return the box</tt> </tt>
<a name="L1370"></a><tt class="py-lineno">1370</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt id="link-76" class="py-name"><a title="upy.hostHelper.Helper.plane" class="py-name" href="#" onclick="return doclink('link-76', 'plane', 'link-75');">plane</a></tt> </tt>
</div><a name="L1371"></a><tt class="py-lineno">1371</tt>  <tt class="py-line"> </tt>
<a name="Helper.update_spline"></a><div id="Helper.update_spline-def"><a name="L1372"></a><tt class="py-lineno">1372</tt> <a class="py-toggle" href="#" id="Helper.update_spline-toggle" onclick="return toggle('Helper.update_spline');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#update_spline">update_spline</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">coords</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.update_spline-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.update_spline-expanded"><a name="L1373"></a><tt class="py-lineno">1373</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1374"></a><tt class="py-lineno">1374</tt>  <tt class="py-line"><tt class="py-docstring">        This will update the spline point coordinate</tt> </tt>
<a name="L1375"></a><tt class="py-lineno">1375</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1376"></a><tt class="py-lineno">1376</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1377"></a><tt class="py-lineno">1377</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the spline to update</tt> </tt>
<a name="L1378"></a><tt class="py-lineno">1378</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array vector</tt> </tt>
<a name="L1379"></a><tt class="py-lineno">1379</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: list of new position coordinate to apply to the curve point</tt> </tt>
<a name="L1380"></a><tt class="py-lineno">1380</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1381"></a><tt class="py-lineno">1381</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1382"></a><tt class="py-lineno">1382</tt>  <tt class="py-line"> </tt>
<a name="L1383"></a><tt class="py-lineno">1383</tt>  <tt class="py-line"> </tt>
<a name="L1384"></a><tt class="py-lineno">1384</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L1385"></a><tt class="py-lineno">1385</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#     Platonic</tt> </tt>
<a name="L1386"></a><tt class="py-lineno">1386</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L1387"></a><tt class="py-lineno">1387</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#this already exist in c4d</tt> </tt>
<a name="L1388"></a><tt class="py-lineno">1388</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#also exist in glut</tt> </tt>
<a name="Helper.Platonic"></a><div id="Helper.Platonic-def"><a name="L1389"></a><tt class="py-lineno">1389</tt> <a class="py-toggle" href="#" id="Helper.Platonic-toggle" onclick="return toggle('Helper.Platonic');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Platonic">Platonic</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">Type</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Platonic-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Platonic-expanded"><a name="L1390"></a><tt class="py-lineno">1390</tt>  <tt class="py-line">        <tt class="py-docstring">""" Generate one of the 5 platonic solid. The name of each figure is derived from its number of faces: respectively "tetra" 4, "hexa" 6, "ocata" 8, "dodeca" 12, and 20.</tt> </tt>
<a name="L1391"></a><tt class="py-lineno">1391</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1392"></a><tt class="py-lineno">1392</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the platonic</tt> </tt>
<a name="L1393"></a><tt class="py-lineno">1393</tt>  <tt class="py-line"><tt class="py-docstring">        @type  Type: string or int</tt> </tt>
<a name="L1394"></a><tt class="py-lineno">1394</tt>  <tt class="py-line"><tt class="py-docstring">        @param Type: type of the platonic, can be tetra" 4, "hexa" 6, "ocata" 8, "dodeca" 12, and "ico" 20.</tt> </tt>
<a name="L1395"></a><tt class="py-lineno">1395</tt>  <tt class="py-line"><tt class="py-docstring">        @type  radius: float</tt> </tt>
<a name="L1396"></a><tt class="py-lineno">1396</tt>  <tt class="py-line"><tt class="py-docstring">        @param radius: radius of the embeding sphere</tt> </tt>
<a name="L1397"></a><tt class="py-lineno">1397</tt>  <tt class="py-line"><tt class="py-docstring">        @type  kw: dictionary</tt> </tt>
<a name="L1398"></a><tt class="py-lineno">1398</tt>  <tt class="py-line"><tt class="py-docstring">        @param kw: additional arguement such as meterial,parent</tt> </tt>
<a name="L1399"></a><tt class="py-lineno">1399</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1400"></a><tt class="py-lineno">1400</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostObject</tt> </tt>
<a name="L1401"></a><tt class="py-lineno">1401</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created platonic</tt> </tt>
<a name="L1402"></a><tt class="py-lineno">1402</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1403"></a><tt class="py-lineno">1403</tt>  <tt class="py-line">        <tt class="py-name">dicT</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-string">"tetra"</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-77" class="py-name" targets="Method upy.hostHelper.Helper.tetrahedron()=upy.hostHelper.Helper-class.html#tetrahedron"><a title="upy.hostHelper.Helper.tetrahedron" class="py-name" href="#" onclick="return doclink('link-77', 'tetrahedron', 'link-77');">tetrahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1404"></a><tt class="py-lineno">1404</tt>  <tt class="py-line">              <tt class="py-string">"hexa"</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-78" class="py-name" targets="Method upy.hostHelper.Helper.hexahedron()=upy.hostHelper.Helper-class.html#hexahedron"><a title="upy.hostHelper.Helper.hexahedron" class="py-name" href="#" onclick="return doclink('link-78', 'hexahedron', 'link-78');">hexahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1405"></a><tt class="py-lineno">1405</tt>  <tt class="py-line">              <tt class="py-string">"octa"</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-79" class="py-name" targets="Method upy.hostHelper.Helper.octahedron()=upy.hostHelper.Helper-class.html#octahedron"><a title="upy.hostHelper.Helper.octahedron" class="py-name" href="#" onclick="return doclink('link-79', 'octahedron', 'link-79');">octahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1406"></a><tt class="py-lineno">1406</tt>  <tt class="py-line">              <tt class="py-string">"dodeca"</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-80" class="py-name" targets="Method upy.hostHelper.Helper.dodecahedron()=upy.hostHelper.Helper-class.html#dodecahedron"><a title="upy.hostHelper.Helper.dodecahedron" class="py-name" href="#" onclick="return doclink('link-80', 'dodecahedron', 'link-80');">dodecahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1407"></a><tt class="py-lineno">1407</tt>  <tt class="py-line">              <tt class="py-string">"icosa"</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-81" class="py-name" targets="Method upy.hostHelper.Helper.icosahedron()=upy.hostHelper.Helper-class.html#icosahedron"><a title="upy.hostHelper.Helper.icosahedron" class="py-name" href="#" onclick="return doclink('link-81', 'icosahedron', 'link-81');">icosahedron</a></tt><tt class="py-op">}</tt><tt class="py-comment">#BuckyBall ?</tt> </tt>
<a name="L1408"></a><tt class="py-lineno">1408</tt>  <tt class="py-line">        <tt class="py-name">dicTF</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-number">4</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-82" class="py-name"><a title="upy.hostHelper.Helper.tetrahedron" class="py-name" href="#" onclick="return doclink('link-82', 'tetrahedron', 'link-77');">tetrahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1409"></a><tt class="py-lineno">1409</tt>  <tt class="py-line">              <tt class="py-number">6</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-83" class="py-name"><a title="upy.hostHelper.Helper.hexahedron" class="py-name" href="#" onclick="return doclink('link-83', 'hexahedron', 'link-78');">hexahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1410"></a><tt class="py-lineno">1410</tt>  <tt class="py-line">              <tt class="py-number">8</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-84" class="py-name"><a title="upy.hostHelper.Helper.octahedron" class="py-name" href="#" onclick="return doclink('link-84', 'octahedron', 'link-79');">octahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1411"></a><tt class="py-lineno">1411</tt>  <tt class="py-line">              <tt class="py-number">12</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-85" class="py-name"><a title="upy.hostHelper.Helper.dodecahedron" class="py-name" href="#" onclick="return doclink('link-85', 'dodecahedron', 'link-80');">dodecahedron</a></tt><tt class="py-op">,</tt> </tt>
<a name="L1412"></a><tt class="py-lineno">1412</tt>  <tt class="py-line">              <tt class="py-number">20</tt><tt class="py-op">:</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-86" class="py-name"><a title="upy.hostHelper.Helper.icosahedron" class="py-name" href="#" onclick="return doclink('link-86', 'icosahedron', 'link-81');">icosahedron</a></tt><tt class="py-op">}</tt> </tt>
<a name="L1413"></a><tt class="py-lineno">1413</tt>  <tt class="py-line">        <tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L1414"></a><tt class="py-lineno">1414</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-string">"parent"</tt> <tt class="py-keyword">in</tt> <tt class="py-name">kw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1415"></a><tt class="py-lineno">1415</tt>  <tt class="py-line">            <tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">kw</tt><tt class="py-op">[</tt><tt class="py-string">"parent"</tt><tt class="py-op">]</tt> </tt>
<a name="L1416"></a><tt class="py-lineno">1416</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">Type</tt> <tt class="py-keyword">in</tt> <tt class="py-name">dicT</tt>  <tt class="py-op">:</tt> </tt>
<a name="L1417"></a><tt class="py-lineno">1417</tt>  <tt class="py-line">            <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">dicT</tt><tt class="py-op">[</tt><tt class="py-name">Type</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1418"></a><tt class="py-lineno">1418</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-87" class="py-name" targets="Method upy.hostHelper.Helper.createsNmesh()=upy.hostHelper.Helper-class.html#createsNmesh"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-87', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">parent</tt><tt class="py-op">)</tt> </tt>
<a name="L1419"></a><tt class="py-lineno">1419</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-name">Type</tt> <tt class="py-keyword">in</tt> <tt class="py-name">dicTF</tt> <tt class="py-op">:</tt> </tt>
<a name="L1420"></a><tt class="py-lineno">1420</tt>  <tt class="py-line">            <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">dicTF</tt><tt class="py-op">[</tt><tt class="py-name">Type</tt><tt class="py-op">]</tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1421"></a><tt class="py-lineno">1421</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-88" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-88', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">parent</tt> <tt class="py-op">=</tt> <tt class="py-name">parent</tt><tt class="py-op">)</tt>             </tt>
<a name="L1422"></a><tt class="py-lineno">1422</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1423"></a><tt class="py-lineno">1423</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">None</tt> </tt>
</div><a name="L1424"></a><tt class="py-lineno">1424</tt>  <tt class="py-line">             </tt>
<a name="Helper.tetrahedron"></a><div id="Helper.tetrahedron-def"><a name="L1425"></a><tt class="py-lineno">1425</tt> <a class="py-toggle" href="#" id="Helper.tetrahedron-toggle" onclick="return toggle('Helper.tetrahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#tetrahedron">tetrahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.tetrahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.tetrahedron-expanded"><a name="L1426"></a><tt class="py-lineno">1426</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1427"></a><tt class="py-lineno">1427</tt>  <tt class="py-line"><tt class="py-docstring">        This will update the spline point coordinate</tt> </tt>
<a name="L1428"></a><tt class="py-lineno">1428</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1429"></a><tt class="py-lineno">1429</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1430"></a><tt class="py-lineno">1430</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the spline to update</tt> </tt>
<a name="L1431"></a><tt class="py-lineno">1431</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array vector</tt> </tt>
<a name="L1432"></a><tt class="py-lineno">1432</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: list of new position coordinate to apply to the curve point</tt> </tt>
<a name="L1433"></a><tt class="py-lineno">1433</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1434"></a><tt class="py-lineno">1434</tt>  <tt class="py-line">         </tt>
<a name="L1435"></a><tt class="py-lineno">1435</tt>  <tt class="py-line">        <tt class="py-name">faceIndices</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#bot</tt> </tt>
<a name="L1436"></a><tt class="py-lineno">1436</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L1437"></a><tt class="py-lineno">1437</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L1438"></a><tt class="py-lineno">1438</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L1439"></a><tt class="py-lineno">1439</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L1440"></a><tt class="py-lineno">1440</tt>  <tt class="py-line">                        <tt class="py-op">)</tt> </tt>
<a name="L1441"></a><tt class="py-lineno">1441</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">/</tt> <tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L1442"></a><tt class="py-lineno">1442</tt>  <tt class="py-line">        <tt class="py-name">faceNormals</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1443"></a><tt class="py-lineno">1443</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L1444"></a><tt class="py-lineno">1444</tt>  <tt class="py-line">                        <tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1445"></a><tt class="py-lineno">1445</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">)</tt>         </tt>
<a name="L1446"></a><tt class="py-lineno">1446</tt>  <tt class="py-line">        <tt class="py-name">diameter</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-number">2</tt> </tt>
<a name="L1447"></a><tt class="py-lineno">1447</tt>  <tt class="py-line">        <tt class="py-name">width</tt>  <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1448"></a><tt class="py-lineno">1448</tt>  <tt class="py-line">        <tt class="py-name">height</tt> <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1449"></a><tt class="py-lineno">1449</tt>  <tt class="py-line">        <tt class="py-name">depth</tt>  <tt class="py-op">=</tt> <tt class="py-name">diameter</tt>      </tt>
<a name="L1450"></a><tt class="py-lineno">1450</tt>  <tt class="py-line">        <tt class="py-name">boundingRadius</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> </tt>
<a name="L1451"></a><tt class="py-lineno">1451</tt>  <tt class="py-line">        <tt class="py-name">surfaceArea</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L1452"></a><tt class="py-lineno">1452</tt>  <tt class="py-line">        <tt class="py-name">volume</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">/</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L1453"></a><tt class="py-lineno">1453</tt>  <tt class="py-line">        <tt class="py-name">_corners</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> </tt>
<a name="L1454"></a><tt class="py-lineno">1454</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1455"></a><tt class="py-lineno">1455</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1456"></a><tt class="py-lineno">1456</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">)</tt><tt class="py-comment">#(0.0, 0.0, radius))</tt> </tt>
<a name="L1457"></a><tt class="py-lineno">1457</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">_corners</tt><tt class="py-op">,</tt><tt class="py-name">faceIndices</tt><tt class="py-op">,</tt><tt class="py-name">faceNormals</tt> </tt>
</div><a name="L1458"></a><tt class="py-lineno">1458</tt>  <tt class="py-line">         </tt>
<a name="Helper.Tetrahedron"></a><div id="Helper.Tetrahedron-def"><a name="L1459"></a><tt class="py-lineno">1459</tt> <a class="py-toggle" href="#" id="Helper.Tetrahedron-toggle" onclick="return toggle('Helper.Tetrahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Tetrahedron">Tetrahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.Tetrahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.Tetrahedron-expanded"><a name="L1460"></a><tt class="py-lineno">1460</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-89" class="py-name"><a title="upy.hostHelper.Helper.tetrahedron" class="py-name" href="#" onclick="return doclink('link-89', 'tetrahedron', 'link-77');">tetrahedron</a></tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1461"></a><tt class="py-lineno">1461</tt>  <tt class="py-line">        <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-90" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-90', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
<a name="L1462"></a><tt class="py-lineno">1462</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> </tt>
</div><a name="L1463"></a><tt class="py-lineno">1463</tt>  <tt class="py-line">         </tt>
<a name="L1464"></a><tt class="py-lineno">1464</tt>  <tt class="py-line">     </tt>
<a name="Helper.hexahedron"></a><div id="Helper.hexahedron-def"><a name="L1465"></a><tt class="py-lineno">1465</tt> <a class="py-toggle" href="#" id="Helper.hexahedron-toggle" onclick="return toggle('Helper.hexahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#hexahedron">hexahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.hexahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.hexahedron-expanded"><a name="L1466"></a><tt class="py-lineno">1466</tt>  <tt class="py-line">         </tt>
<a name="L1467"></a><tt class="py-lineno">1467</tt>  <tt class="py-line">        <tt class="py-name">faceIndices</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#bot</tt> </tt>
<a name="L1468"></a><tt class="py-lineno">1468</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">7</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#top</tt> </tt>
<a name="L1469"></a><tt class="py-lineno">1469</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#front</tt> </tt>
<a name="L1470"></a><tt class="py-lineno">1470</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#right</tt> </tt>
<a name="L1471"></a><tt class="py-lineno">1471</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">7</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#rear</tt> </tt>
<a name="L1472"></a><tt class="py-lineno">1472</tt>  <tt class="py-line">                        <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-comment">#left</tt> </tt>
<a name="L1473"></a><tt class="py-lineno">1473</tt>  <tt class="py-line">                        <tt class="py-op">)</tt> </tt>
<a name="L1474"></a><tt class="py-lineno">1474</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-number">1.0</tt> </tt>
<a name="L1475"></a><tt class="py-lineno">1475</tt>  <tt class="py-line">        <tt class="py-name">faceNormals</tt> <tt class="py-op">=</tt> <tt class="py-name">None</tt> </tt>
<a name="L1476"></a><tt class="py-lineno">1476</tt>  <tt class="py-line">        <tt class="py-name">diameter</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-number">2</tt> </tt>
<a name="L1477"></a><tt class="py-lineno">1477</tt>  <tt class="py-line">        <tt class="py-name">width</tt>  <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1478"></a><tt class="py-lineno">1478</tt>  <tt class="py-line">        <tt class="py-name">height</tt> <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1479"></a><tt class="py-lineno">1479</tt>  <tt class="py-line">        <tt class="py-name">depth</tt>  <tt class="py-op">=</tt> <tt class="py-name">radius</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">radians</tt><tt class="py-op">(</tt><tt class="py-number">45.</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1480"></a><tt class="py-lineno">1480</tt>  <tt class="py-line">        <tt class="py-name">boundingRadius</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> </tt>
<a name="L1481"></a><tt class="py-lineno">1481</tt>  <tt class="py-line">        <tt class="py-name">surfaceArea</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L1482"></a><tt class="py-lineno">1482</tt>  <tt class="py-line">        <tt class="py-name">volume</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">/</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L1483"></a><tt class="py-lineno">1483</tt>  <tt class="py-line">        <tt class="py-name">_corners</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> </tt>
<a name="L1484"></a><tt class="py-lineno">1484</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1485"></a><tt class="py-lineno">1485</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1486"></a><tt class="py-lineno">1486</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1487"></a><tt class="py-lineno">1487</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-name">depth</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">)</tt> </tt>
<a name="L1488"></a><tt class="py-lineno">1488</tt>  <tt class="py-line"> </tt>
<a name="L1489"></a><tt class="py-lineno">1489</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">_corners</tt><tt class="py-op">,</tt><tt class="py-name">faceIndices</tt><tt class="py-op">,</tt><tt class="py-name">faceNormals</tt> </tt>
</div><a name="L1490"></a><tt class="py-lineno">1490</tt>  <tt class="py-line">         </tt>
<a name="Helper.Hexahedron"></a><div id="Helper.Hexahedron-def"><a name="L1491"></a><tt class="py-lineno">1491</tt> <a class="py-toggle" href="#" id="Helper.Hexahedron-toggle" onclick="return toggle('Helper.Hexahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Hexahedron">Hexahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>     </tt>
</div><a name="L1492"></a><tt class="py-lineno">1492</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-91" class="py-name"><a title="upy.hostHelper.Helper.hexahedron" class="py-name" href="#" onclick="return doclink('link-91', 'hexahedron', 'link-78');">hexahedron</a></tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1493"></a><tt class="py-lineno">1493</tt>  <tt class="py-line">        <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-92" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-92', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
<a name="L1494"></a><tt class="py-lineno">1494</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt>     </tt>
</div><a name="L1495"></a><tt class="py-lineno">1495</tt>  <tt class="py-line">     </tt>
<a name="Helper.octahedron"></a><div id="Helper.octahedron-def"><a name="L1496"></a><tt class="py-lineno">1496</tt> <a class="py-toggle" href="#" id="Helper.octahedron-toggle" onclick="return toggle('Helper.octahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#octahedron">octahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.octahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.octahedron-expanded"><a name="L1497"></a><tt class="py-lineno">1497</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1498"></a><tt class="py-lineno">1498</tt>  <tt class="py-line"><tt class="py-docstring">        This will update the spline point coordinate</tt> </tt>
<a name="L1499"></a><tt class="py-lineno">1499</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1500"></a><tt class="py-lineno">1500</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1501"></a><tt class="py-lineno">1501</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the spline to update</tt> </tt>
<a name="L1502"></a><tt class="py-lineno">1502</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array vector</tt> </tt>
<a name="L1503"></a><tt class="py-lineno">1503</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: list of new position coordinate to apply to the curve point</tt> </tt>
<a name="L1504"></a><tt class="py-lineno">1504</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1505"></a><tt class="py-lineno">1505</tt>  <tt class="py-line">         </tt>
<a name="L1506"></a><tt class="py-lineno">1506</tt>  <tt class="py-line">        <tt class="py-name">faceIndices</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">5</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1507"></a><tt class="py-lineno">1507</tt>  <tt class="py-line">                             <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">,</tt> <tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">,</tt> <tt class="py-number">1</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt> <tt class="py-number">5</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1508"></a><tt class="py-lineno">1508</tt>  <tt class="py-line">        <tt class="py-name">a</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> <tt class="py-op">/</tt> <tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L1509"></a><tt class="py-lineno">1509</tt>  <tt class="py-line">        <tt class="py-name">faceNormals</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1510"></a><tt class="py-lineno">1510</tt>  <tt class="py-line">                             <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1511"></a><tt class="py-lineno">1511</tt>  <tt class="py-line">                             <tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt> <tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1512"></a><tt class="py-lineno">1512</tt>  <tt class="py-line">                             <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">,</tt>  <tt class="py-name">a</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1513"></a><tt class="py-lineno">1513</tt>  <tt class="py-line">        <tt class="py-name">diameter</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> <tt class="py-op">*</tt> <tt class="py-number">2</tt> </tt>
<a name="L1514"></a><tt class="py-lineno">1514</tt>  <tt class="py-line">        <tt class="py-name">width</tt>  <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1515"></a><tt class="py-lineno">1515</tt>  <tt class="py-line">        <tt class="py-name">height</tt> <tt class="py-op">=</tt> <tt class="py-name">diameter</tt> </tt>
<a name="L1516"></a><tt class="py-lineno">1516</tt>  <tt class="py-line">        <tt class="py-name">depth</tt>  <tt class="py-op">=</tt> <tt class="py-name">diameter</tt>      </tt>
<a name="L1517"></a><tt class="py-lineno">1517</tt>  <tt class="py-line">        <tt class="py-name">boundingRadius</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt> </tt>
<a name="L1518"></a><tt class="py-lineno">1518</tt>  <tt class="py-line">        <tt class="py-name">surfaceArea</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">sqrt</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">/</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">2</tt><tt class="py-op">)</tt> </tt>
<a name="L1519"></a><tt class="py-lineno">1519</tt>  <tt class="py-line">        <tt class="py-name">volume</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">/</tt><tt class="py-number">3</tt><tt class="py-op">)</tt> <tt class="py-op">*</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt> <tt class="py-op">**</tt> <tt class="py-number">3</tt><tt class="py-op">)</tt> </tt>
<a name="L1520"></a><tt class="py-lineno">1520</tt>  <tt class="py-line">        <tt class="py-name">_corners</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt> </tt>
<a name="L1521"></a><tt class="py-lineno">1521</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1522"></a><tt class="py-lineno">1522</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1523"></a><tt class="py-lineno">1523</tt>  <tt class="py-line">            <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-op">-</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-number">0.0</tt><tt class="py-op">,</tt> <tt class="py-name">radius</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1524"></a><tt class="py-lineno">1524</tt>  <tt class="py-line"> </tt>
<a name="L1525"></a><tt class="py-lineno">1525</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">_corners</tt><tt class="py-op">,</tt><tt class="py-name">faceIndices</tt><tt class="py-op">,</tt><tt class="py-name">faceNormals</tt> </tt>
</div><a name="L1526"></a><tt class="py-lineno">1526</tt>  <tt class="py-line">         </tt>
<a name="Helper.Octahedron"></a><div id="Helper.Octahedron-def"><a name="L1527"></a><tt class="py-lineno">1527</tt> <a class="py-toggle" href="#" id="Helper.Octahedron-toggle" onclick="return toggle('Helper.Octahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Octahedron">Octahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>     </tt>
</div><a name="L1528"></a><tt class="py-lineno">1528</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-93" class="py-name"><a title="upy.hostHelper.Helper.octahedron" class="py-name" href="#" onclick="return doclink('link-93', 'octahedron', 'link-79');">octahedron</a></tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1529"></a><tt class="py-lineno">1529</tt>  <tt class="py-line">        <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-94" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-94', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
<a name="L1530"></a><tt class="py-lineno">1530</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> </tt>
</div><a name="L1531"></a><tt class="py-lineno">1531</tt>  <tt class="py-line"> </tt>
<a name="L1532"></a><tt class="py-lineno">1532</tt>  <tt class="py-line"> </tt>
<a name="L1533"></a><tt class="py-lineno">1533</tt>  <tt class="py-line">     </tt>
<a name="Helper.dodecahedron"></a><div id="Helper.dodecahedron-def"><a name="L1534"></a><tt class="py-lineno">1534</tt> <a class="py-toggle" href="#" id="Helper.dodecahedron-toggle" onclick="return toggle('Helper.dodecahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#dodecahedron">dodecahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.dodecahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.dodecahedron-expanded"><a name="L1535"></a><tt class="py-lineno">1535</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1536"></a><tt class="py-lineno">1536</tt>  <tt class="py-line"><tt class="py-docstring">        This will update the spline point coordinate</tt> </tt>
<a name="L1537"></a><tt class="py-lineno">1537</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1538"></a><tt class="py-lineno">1538</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1539"></a><tt class="py-lineno">1539</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the spline to update</tt> </tt>
<a name="L1540"></a><tt class="py-lineno">1540</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array vector</tt> </tt>
<a name="L1541"></a><tt class="py-lineno">1541</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: list of new position coordinate to apply to the curve point</tt> </tt>
<a name="L1542"></a><tt class="py-lineno">1542</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1543"></a><tt class="py-lineno">1543</tt>  <tt class="py-line">        <tt class="py-comment">#from http://www.cs.umbc.edu/~squire/reference/polyhedra.shtml#dodecahedron</tt> </tt>
<a name="L1544"></a><tt class="py-lineno">1544</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">vertices</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-comment">#; /* 20 vertices with x, y, z coordinate */</tt> </tt>
<a name="L1545"></a><tt class="py-lineno">1545</tt>  <tt class="py-line">        <tt class="py-name">Pi</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt id="link-95" class="py-name"><a title="upy.hostHelper.pi" class="py-name" href="#" onclick="return doclink('link-95', 'pi', 'link-18');">pi</a></tt> </tt>
<a name="L1546"></a><tt class="py-lineno">1546</tt>  <tt class="py-line">        <tt class="py-name">phiaa</tt> <tt class="py-op">=</tt> <tt class="py-number">52.62263590</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* the two phi angles needed for generation */</tt> </tt>
<a name="L1547"></a><tt class="py-lineno">1547</tt>  <tt class="py-line">        <tt class="py-name">phibb</tt> <tt class="py-op">=</tt> <tt class="py-number">10.81231754</tt><tt class="py-op">;</tt> </tt>
<a name="L1548"></a><tt class="py-lineno">1548</tt>  <tt class="py-line">        <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* any radius in which the polyhedron is inscribed */</tt> </tt>
<a name="L1549"></a><tt class="py-lineno">1549</tt>  <tt class="py-line">        <tt class="py-name">phia</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-name">phiaa</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* 4 sets of five points each */</tt> </tt>
<a name="L1550"></a><tt class="py-lineno">1550</tt>  <tt class="py-line">        <tt class="py-name">phib</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-name">phibb</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1551"></a><tt class="py-lineno">1551</tt>  <tt class="py-line">        <tt class="py-name">phic</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">phibb</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1552"></a><tt class="py-lineno">1552</tt>  <tt class="py-line">        <tt class="py-name">phid</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">phiaa</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1553"></a><tt class="py-lineno">1553</tt>  <tt class="py-line">        <tt class="py-name">the72</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-number">72.0</tt><tt class="py-op">/</tt><tt class="py-number">180</tt><tt class="py-op">;</tt> </tt>
<a name="L1554"></a><tt class="py-lineno">1554</tt>  <tt class="py-line">        <tt class="py-name">theb</tt> <tt class="py-op">=</tt> <tt class="py-name">the72</tt><tt class="py-op">/</tt><tt class="py-number">2.0</tt><tt class="py-comment">#; /* pairs of layers offset 36 degrees */</tt> </tt>
<a name="L1555"></a><tt class="py-lineno">1555</tt>  <tt class="py-line">        <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-number">0.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1556"></a><tt class="py-lineno">1556</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1557"></a><tt class="py-lineno">1557</tt>  <tt class="py-line">            <tt id="link-96" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-96', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1558"></a><tt class="py-lineno">1558</tt>  <tt class="py-line">            <tt id="link-97" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-97', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1559"></a><tt class="py-lineno">1559</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1560"></a><tt class="py-lineno">1560</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-98" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-98', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-99" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-99', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1561"></a><tt class="py-lineno">1561</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt> </tt>
<a name="L1562"></a><tt class="py-lineno">1562</tt>  <tt class="py-line">   </tt>
<a name="L1563"></a><tt class="py-lineno">1563</tt>  <tt class="py-line">        <tt class="py-name">the</tt><tt class="py-op">=</tt><tt class="py-number">0.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1564"></a><tt class="py-lineno">1564</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-number">10</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-comment">#(i=5; i&lt;10; i++)</tt> </tt>
<a name="L1565"></a><tt class="py-lineno">1565</tt>  <tt class="py-line">            <tt id="link-100" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-100', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phib</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1566"></a><tt class="py-lineno">1566</tt>  <tt class="py-line">            <tt id="link-101" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-101', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phib</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1567"></a><tt class="py-lineno">1567</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">phib</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1568"></a><tt class="py-lineno">1568</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-102" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-102', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-103" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-103', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1569"></a><tt class="py-lineno">1569</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt> </tt>
<a name="L1570"></a><tt class="py-lineno">1570</tt>  <tt class="py-line">   </tt>
<a name="L1571"></a><tt class="py-lineno">1571</tt>  <tt class="py-line">        <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">theb</tt><tt class="py-op">;</tt> </tt>
<a name="L1572"></a><tt class="py-lineno">1572</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-number">15</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-comment">#for(i=10; i&lt;15; i++)</tt> </tt>
<a name="L1573"></a><tt class="py-lineno">1573</tt>  <tt class="py-line">            <tt id="link-104" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-104', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phic</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1574"></a><tt class="py-lineno">1574</tt>  <tt class="py-line">            <tt id="link-105" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-105', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phic</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1575"></a><tt class="py-lineno">1575</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">phic</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1576"></a><tt class="py-lineno">1576</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-106" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-106', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-107" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-107', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1577"></a><tt class="py-lineno">1577</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt> </tt>
<a name="L1578"></a><tt class="py-lineno">1578</tt>  <tt class="py-line">             </tt>
<a name="L1579"></a><tt class="py-lineno">1579</tt>  <tt class="py-line">        <tt class="py-name">the</tt><tt class="py-op">=</tt><tt class="py-name">theb</tt><tt class="py-op">;</tt> </tt>
<a name="L1580"></a><tt class="py-lineno">1580</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">15</tt><tt class="py-op">,</tt><tt class="py-number">20</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-comment">#for(i=15; i&lt;20; i++)</tt> </tt>
<a name="L1581"></a><tt class="py-lineno">1581</tt>  <tt class="py-line">            <tt id="link-108" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-108', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phid</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1582"></a><tt class="py-lineno">1582</tt>  <tt class="py-line">            <tt id="link-109" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-109', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phid</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1583"></a><tt class="py-lineno">1583</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">phid</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1584"></a><tt class="py-lineno">1584</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-110" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-110', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-111" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-111', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1585"></a><tt class="py-lineno">1585</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt> </tt>
<a name="L1586"></a><tt class="py-lineno">1586</tt>  <tt class="py-line">   </tt>
<a name="L1587"></a><tt class="py-lineno">1587</tt>  <tt class="py-line">        <tt class="py-comment">#/* map vertices to 12 faces */</tt> </tt>
<a name="L1588"></a><tt class="py-lineno">1588</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#these are the ngons</tt> </tt>
<a name="L1589"></a><tt class="py-lineno">1589</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">ngonsfaces</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">,</tt><tt class="py-number">11</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1590"></a><tt class="py-lineno">1590</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">8</tt><tt class="py-op">,</tt><tt class="py-number">12</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">9</tt><tt class="py-op">,</tt><tt class="py-number">13</tt><tt class="py-op">,</tt><tt class="py-number">8</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-number">14</tt><tt class="py-op">,</tt><tt class="py-number">9</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1591"></a><tt class="py-lineno">1591</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-number">15</tt><tt class="py-op">,</tt><tt class="py-number">16</tt><tt class="py-op">,</tt><tt class="py-number">11</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">10</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">16</tt><tt class="py-op">,</tt><tt class="py-number">17</tt><tt class="py-op">,</tt><tt class="py-number">12</tt><tt class="py-op">,</tt><tt class="py-number">7</tt><tt class="py-op">,</tt><tt class="py-number">11</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">17</tt><tt class="py-op">,</tt><tt class="py-number">18</tt><tt class="py-op">,</tt><tt class="py-number">13</tt><tt class="py-op">,</tt><tt class="py-number">8</tt><tt class="py-op">,</tt><tt class="py-number">12</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L1592"></a><tt class="py-lineno">1592</tt>  <tt class="py-line">                <tt class="py-op">(</tt><tt class="py-number">18</tt><tt class="py-op">,</tt><tt class="py-number">19</tt><tt class="py-op">,</tt><tt class="py-number">14</tt><tt class="py-op">,</tt><tt class="py-number">9</tt><tt class="py-op">,</tt><tt class="py-number">13</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">19</tt><tt class="py-op">,</tt><tt class="py-number">15</tt><tt class="py-op">,</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-number">14</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">15</tt><tt class="py-op">,</tt><tt class="py-number">16</tt><tt class="py-op">,</tt><tt class="py-number">17</tt><tt class="py-op">,</tt><tt class="py-number">18</tt><tt class="py-op">,</tt><tt class="py-number">19</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1593"></a><tt class="py-lineno">1593</tt>  <tt class="py-line">        <tt class="py-comment">#triangualte</tt> </tt>
<a name="L1594"></a><tt class="py-lineno">1594</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">faces</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1595"></a><tt class="py-lineno">1595</tt>  <tt class="py-line">        <tt class="py-comment">#wrong sense for some face</tt> </tt>
<a name="L1596"></a><tt class="py-lineno">1596</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">ngonsfaces</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1597"></a><tt class="py-lineno">1597</tt>  <tt class="py-line">            <tt class="py-comment">#create three faces from one ngonsface</tt> </tt>
<a name="L1598"></a><tt class="py-lineno">1598</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">if</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">,</tt><tt class="py-number">4</tt><tt class="py-op">,</tt><tt class="py-number">5</tt><tt class="py-op">,</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">ngonsfaces</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt><tt class="py-comment">#last one</tt> </tt>
<a name="L1599"></a><tt class="py-lineno">1599</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt> </tt>
<a name="L1600"></a><tt class="py-lineno">1600</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt> </tt>
<a name="L1601"></a><tt class="py-lineno">1601</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt>                </tt>
<a name="L1602"></a><tt class="py-lineno">1602</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1603"></a><tt class="py-lineno">1603</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt> </tt>
<a name="L1604"></a><tt class="py-lineno">1604</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt> </tt>
<a name="L1605"></a><tt class="py-lineno">1605</tt>  <tt class="py-line">                <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt> </tt>
<a name="L1606"></a><tt class="py-lineno">1606</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">vertices</tt><tt class="py-op">,</tt><tt class="py-name">faces</tt><tt class="py-op">,</tt><tt class="py-name">None</tt> </tt>
</div><a name="L1607"></a><tt class="py-lineno">1607</tt>  <tt class="py-line">         </tt>
<a name="Helper.Dodecahedron"></a><div id="Helper.Dodecahedron-def"><a name="L1608"></a><tt class="py-lineno">1608</tt> <a class="py-toggle" href="#" id="Helper.Dodecahedron-toggle" onclick="return toggle('Helper.Dodecahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Dodecahedron">Dodecahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>     </tt>
</div><a name="L1609"></a><tt class="py-lineno">1609</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-112" class="py-name"><a title="upy.hostHelper.Helper.dodecahedron" class="py-name" href="#" onclick="return doclink('link-112', 'dodecahedron', 'link-80');">dodecahedron</a></tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1610"></a><tt class="py-lineno">1610</tt>  <tt class="py-line">        <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-113" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-113', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
<a name="L1611"></a><tt class="py-lineno">1611</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> </tt>
</div><a name="L1612"></a><tt class="py-lineno">1612</tt>  <tt class="py-line"> </tt>
<a name="L1613"></a><tt class="py-lineno">1613</tt>  <tt class="py-line"> </tt>
<a name="Helper.icosahedron"></a><div id="Helper.icosahedron-def"><a name="L1614"></a><tt class="py-lineno">1614</tt> <a class="py-toggle" href="#" id="Helper.icosahedron-toggle" onclick="return toggle('Helper.icosahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#icosahedron">icosahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.icosahedron-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.icosahedron-expanded"><a name="L1615"></a><tt class="py-lineno">1615</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L1616"></a><tt class="py-lineno">1616</tt>  <tt class="py-line"><tt class="py-docstring">        This will update the spline point coordinate</tt> </tt>
<a name="L1617"></a><tt class="py-lineno">1617</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L1618"></a><tt class="py-lineno">1618</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L1619"></a><tt class="py-lineno">1619</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name for the spline to update</tt> </tt>
<a name="L1620"></a><tt class="py-lineno">1620</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: liste/array vector</tt> </tt>
<a name="L1621"></a><tt class="py-lineno">1621</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: list of new position coordinate to apply to the curve point</tt> </tt>
<a name="L1622"></a><tt class="py-lineno">1622</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L1623"></a><tt class="py-lineno">1623</tt>  <tt class="py-line">         </tt>
<a name="L1624"></a><tt class="py-lineno">1624</tt>  <tt class="py-line">        <tt class="py-comment">#from http://www.cs.umbc.edu/~squire/reference/polyhedra.shtml#dodecahedron</tt> </tt>
<a name="L1625"></a><tt class="py-lineno">1625</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">vertices</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-comment">#; /* 20 vertices with x, y, z coordinate */</tt> </tt>
<a name="L1626"></a><tt class="py-lineno">1626</tt>  <tt class="py-line">        <tt class="py-name">Pi</tt> <tt class="py-op">=</tt> <tt class="py-name">math</tt><tt class="py-op">.</tt><tt id="link-114" class="py-name"><a title="upy.hostHelper.pi" class="py-name" href="#" onclick="return doclink('link-114', 'pi', 'link-18');">pi</a></tt> </tt>
<a name="L1627"></a><tt class="py-lineno">1627</tt>  <tt class="py-line">        <tt class="py-name">phiaa</tt>  <tt class="py-op">=</tt> <tt class="py-number">26.56505</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* the two phi angles needed for generation */</tt> </tt>
<a name="L1628"></a><tt class="py-lineno">1628</tt>  <tt class="py-line">         </tt>
<a name="L1629"></a><tt class="py-lineno">1629</tt>  <tt class="py-line">        <tt class="py-name">r</tt> <tt class="py-op">=</tt> <tt class="py-name">radius</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* any radius in which the polyhedron is inscribed */</tt> </tt>
<a name="L1630"></a><tt class="py-lineno">1630</tt>  <tt class="py-line">        <tt class="py-name">phia</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-name">phiaa</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt> <tt class="py-comment">#/* 2 sets of four points */</tt> </tt>
<a name="L1631"></a><tt class="py-lineno">1631</tt>  <tt class="py-line">        <tt class="py-name">theb</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-number">36.0</tt><tt class="py-op">/</tt><tt class="py-number">180.0</tt><tt class="py-op">;</tt>  <tt class="py-comment">#/* offset second set 36 degrees */</tt> </tt>
<a name="L1632"></a><tt class="py-lineno">1632</tt>  <tt class="py-line">        <tt class="py-name">the72</tt> <tt class="py-op">=</tt> <tt class="py-name">Pi</tt><tt class="py-op">*</tt><tt class="py-number">72.0</tt><tt class="py-op">/</tt><tt class="py-number">180</tt><tt class="py-op">;</tt>   <tt class="py-comment">#/* step 72 degrees */</tt> </tt>
<a name="L1633"></a><tt class="py-lineno">1633</tt>  <tt class="py-line">         </tt>
<a name="L1634"></a><tt class="py-lineno">1634</tt>  <tt class="py-line">        <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-name">r</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1635"></a><tt class="py-lineno">1635</tt>  <tt class="py-line">         </tt>
<a name="L1636"></a><tt class="py-lineno">1636</tt>  <tt class="py-line">        <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-number">0.0</tt><tt class="py-op">;</tt> </tt>
<a name="L1637"></a><tt class="py-lineno">1637</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">6</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1638"></a><tt class="py-lineno">1638</tt>  <tt class="py-line">            <tt id="link-115" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-115', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1639"></a><tt class="py-lineno">1639</tt>  <tt class="py-line">            <tt id="link-116" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-116', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1640"></a><tt class="py-lineno">1640</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1641"></a><tt class="py-lineno">1641</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-117" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-117', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-118" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-118', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1642"></a><tt class="py-lineno">1642</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt> </tt>
<a name="L1643"></a><tt class="py-lineno">1643</tt>  <tt class="py-line">         </tt>
<a name="L1644"></a><tt class="py-lineno">1644</tt>  <tt class="py-line">        <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">theb</tt><tt class="py-op">;</tt> </tt>
<a name="L1645"></a><tt class="py-lineno">1645</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">6</tt><tt class="py-op">,</tt><tt class="py-number">11</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-comment">#for(i=10; i&lt;15; i++)</tt> </tt>
<a name="L1646"></a><tt class="py-lineno">1646</tt>  <tt class="py-line">            <tt id="link-119" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-119', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1647"></a><tt class="py-lineno">1647</tt>  <tt class="py-line">            <tt id="link-120" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-120', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-name">the</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">cos</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1648"></a><tt class="py-lineno">1648</tt>  <tt class="py-line">            <tt class="py-name">z</tt><tt class="py-op">=</tt><tt class="py-name">r</tt><tt class="py-op">*</tt><tt class="py-name">sin</tt><tt class="py-op">(</tt><tt class="py-op">-</tt><tt class="py-name">phia</tt><tt class="py-op">)</tt><tt class="py-op">;</tt> </tt>
<a name="L1649"></a><tt class="py-lineno">1649</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt id="link-121" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-121', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-122" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-122', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">z</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1650"></a><tt class="py-lineno">1650</tt>  <tt class="py-line">            <tt class="py-name">the</tt> <tt class="py-op">=</tt> <tt class="py-name">the</tt><tt class="py-op">+</tt><tt class="py-name">the72</tt><tt class="py-op">;</tt>   </tt>
<a name="L1651"></a><tt class="py-lineno">1651</tt>  <tt class="py-line">         </tt>
<a name="L1652"></a><tt class="py-lineno">1652</tt>  <tt class="py-line">        <tt class="py-name">vertices</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-number">0.0</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-name">r</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1653"></a><tt class="py-lineno">1653</tt>  <tt class="py-line">   </tt>
<a name="L1654"></a><tt class="py-lineno">1654</tt>  <tt class="py-line">        <tt class="py-comment">#/* map vertices to 12 faces */</tt> </tt>
<a name="L1655"></a><tt class="py-lineno">1655</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#these are the ngons</tt> </tt>
<a name="L1656"></a><tt class="py-lineno">1656</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">faces</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">[</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt>  <tt class="py-number">1</tt><tt class="py-op">,</tt>  <tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1657"></a><tt class="py-lineno">1657</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt>  <tt class="py-number">2</tt><tt class="py-op">,</tt>  <tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1658"></a><tt class="py-lineno">1658</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt>  <tt class="py-number">3</tt><tt class="py-op">,</tt>  <tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1659"></a><tt class="py-lineno">1659</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt>  <tt class="py-number">4</tt><tt class="py-op">,</tt>  <tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1660"></a><tt class="py-lineno">1660</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt>  <tt class="py-number">5</tt><tt class="py-op">,</tt>  <tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1661"></a><tt class="py-lineno">1661</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">7</tt><tt class="py-op">,</tt>  <tt class="py-number">6</tt><tt class="py-op">,</tt> <tt class="py-number">11</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1662"></a><tt class="py-lineno">1662</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">8</tt><tt class="py-op">,</tt>  <tt class="py-number">7</tt><tt class="py-op">,</tt> <tt class="py-number">11</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1663"></a><tt class="py-lineno">1663</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">9</tt><tt class="py-op">,</tt>  <tt class="py-number">8</tt><tt class="py-op">,</tt> <tt class="py-number">11</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1664"></a><tt class="py-lineno">1664</tt>  <tt class="py-line">       <tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">,</tt>  <tt class="py-number">9</tt><tt class="py-op">,</tt> <tt class="py-number">11</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1665"></a><tt class="py-lineno">1665</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">6</tt><tt class="py-op">,</tt> <tt class="py-number">10</tt><tt class="py-op">,</tt> <tt class="py-number">11</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1666"></a><tt class="py-lineno">1666</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">6</tt><tt class="py-op">,</tt>  <tt class="py-number">2</tt><tt class="py-op">,</tt>  <tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1667"></a><tt class="py-lineno">1667</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">7</tt><tt class="py-op">,</tt>  <tt class="py-number">3</tt><tt class="py-op">,</tt>  <tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1668"></a><tt class="py-lineno">1668</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">8</tt><tt class="py-op">,</tt>  <tt class="py-number">4</tt><tt class="py-op">,</tt>  <tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1669"></a><tt class="py-lineno">1669</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">9</tt><tt class="py-op">,</tt>  <tt class="py-number">5</tt><tt class="py-op">,</tt>  <tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1670"></a><tt class="py-lineno">1670</tt>  <tt class="py-line">       <tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">,</tt>  <tt class="py-number">1</tt><tt class="py-op">,</tt>  <tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1671"></a><tt class="py-lineno">1671</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">6</tt><tt class="py-op">,</tt>  <tt class="py-number">7</tt><tt class="py-op">,</tt>  <tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1672"></a><tt class="py-lineno">1672</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">7</tt><tt class="py-op">,</tt>  <tt class="py-number">8</tt><tt class="py-op">,</tt>  <tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1673"></a><tt class="py-lineno">1673</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">8</tt><tt class="py-op">,</tt>  <tt class="py-number">9</tt><tt class="py-op">,</tt>  <tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1674"></a><tt class="py-lineno">1674</tt>  <tt class="py-line">       <tt class="py-op">[</tt> <tt class="py-number">9</tt><tt class="py-op">,</tt> <tt class="py-number">10</tt><tt class="py-op">,</tt>  <tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1675"></a><tt class="py-lineno">1675</tt>  <tt class="py-line">       <tt class="py-op">[</tt><tt class="py-number">10</tt><tt class="py-op">,</tt>  <tt class="py-number">6</tt><tt class="py-op">,</tt>  <tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1676"></a><tt class="py-lineno">1676</tt>  <tt class="py-line"> </tt>
<a name="L1677"></a><tt class="py-lineno">1677</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">vertices</tt><tt class="py-op">,</tt><tt class="py-name">faces</tt><tt class="py-op">,</tt><tt class="py-name">None</tt> </tt>
</div><a name="L1678"></a><tt class="py-lineno">1678</tt>  <tt class="py-line">         </tt>
<a name="Helper.Icosahedron"></a><div id="Helper.Icosahedron-def"><a name="L1679"></a><tt class="py-lineno">1679</tt> <a class="py-toggle" href="#" id="Helper.Icosahedron-toggle" onclick="return toggle('Helper.Icosahedron');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#Icosahedron">Icosahedron</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">radius</tt><tt class="py-op">)</tt><tt class="py-op">:</tt>     </tt>
</div><a name="L1680"></a><tt class="py-lineno">1680</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-123" class="py-name"><a title="upy.hostHelper.Helper.icosahedron" class="py-name" href="#" onclick="return doclink('link-123', 'icosahedron', 'link-81');">icosahedron</a></tt><tt class="py-op">(</tt><tt class="py-name">radius</tt><tt class="py-op">)</tt> </tt>
<a name="L1681"></a><tt class="py-lineno">1681</tt>  <tt class="py-line">        <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-124" class="py-name"><a title="upy.hostHelper.Helper.createsNmesh" class="py-name" href="#" onclick="return doclink('link-124', 'createsNmesh', 'link-87');">createsNmesh</a></tt><tt class="py-op">(</tt><tt class="py-name">name</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> </tt>
<a name="L1682"></a><tt class="py-lineno">1682</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">ob</tt><tt class="py-op">,</tt><tt class="py-name">obme</tt> </tt>
</div><a name="L1683"></a><tt class="py-lineno">1683</tt>  <tt class="py-line">         </tt>
<a name="L1684"></a><tt class="py-lineno">1684</tt>  <tt class="py-line">     </tt>
<a name="Helper.progressBar"></a><div id="Helper.progressBar-def"><a name="L1685"></a><tt class="py-lineno">1685</tt> <a class="py-toggle" href="#" id="Helper.progressBar-toggle" onclick="return toggle('Helper.progressBar');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#progressBar">progressBar</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">progress</tt><tt class="py-op">,</tt><tt class="py-param">label</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.progressBar-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.progressBar-expanded"><a name="L1686"></a><tt class="py-lineno">1686</tt>  <tt class="py-line">        <tt class="py-docstring">""" update the progress bar status by progress value and label string</tt> </tt>
<a name="L1687"></a><tt class="py-lineno">1687</tt>  <tt class="py-line"><tt class="py-docstring">        @type  progress: Int/Float</tt> </tt>
<a name="L1688"></a><tt class="py-lineno">1688</tt>  <tt class="py-line"><tt class="py-docstring">        @param progress: the new progress</tt> </tt>
<a name="L1689"></a><tt class="py-lineno">1689</tt>  <tt class="py-line"><tt class="py-docstring">        @type  label: string</tt> </tt>
<a name="L1690"></a><tt class="py-lineno">1690</tt>  <tt class="py-line"><tt class="py-docstring">        @param label: the new message to put in the progress status</tt> </tt>
<a name="L1691"></a><tt class="py-lineno">1691</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>                 </tt>
<a name="L1692"></a><tt class="py-lineno">1692</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1693"></a><tt class="py-lineno">1693</tt>  <tt class="py-line"> </tt>
<a name="Helper.resetProgressBar"></a><div id="Helper.resetProgressBar-def"><a name="L1694"></a><tt class="py-lineno">1694</tt> <a class="py-toggle" href="#" id="Helper.resetProgressBar-toggle" onclick="return toggle('Helper.resetProgressBar');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#resetProgressBar">resetProgressBar</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.resetProgressBar-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.resetProgressBar-expanded"><a name="L1695"></a><tt class="py-lineno">1695</tt>  <tt class="py-line">        <tt class="py-docstring">"""reset the Progress Bar, using value"""</tt> </tt>
<a name="L1696"></a><tt class="py-lineno">1696</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1697"></a><tt class="py-lineno">1697</tt>  <tt class="py-line"> </tt>
<a name="L1698"></a><tt class="py-lineno">1698</tt>  <tt class="py-line">         </tt>
<a name="L1699"></a><tt class="py-lineno">1699</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L1700"></a><tt class="py-lineno">1700</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#     Texture Mapping / UV</tt> </tt>
<a name="L1701"></a><tt class="py-lineno">1701</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="Helper.getUVs"></a><div id="Helper.getUVs-def"><a name="L1702"></a><tt class="py-lineno">1702</tt> <a class="py-toggle" href="#" id="Helper.getUVs-toggle" onclick="return toggle('Helper.getUVs');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getUVs">getUVs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getUVs-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getUVs-expanded"><a name="L1703"></a><tt class="py-lineno">1703</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1704"></a><tt class="py-lineno">1704</tt>  <tt class="py-line">         </tt>
<a name="Helper.setUVs"></a><div id="Helper.setUVs-def"><a name="L1705"></a><tt class="py-lineno">1705</tt> <a class="py-toggle" href="#" id="Helper.setUVs-toggle" onclick="return toggle('Helper.setUVs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#setUVs">setUVs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.setUVs-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.setUVs-expanded"><a name="L1706"></a><tt class="py-lineno">1706</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1707"></a><tt class="py-lineno">1707</tt>  <tt class="py-line">         </tt>
<a name="Helper.getUV"></a><div id="Helper.getUV-def"><a name="L1708"></a><tt class="py-lineno">1708</tt> <a class="py-toggle" href="#" id="Helper.getUV-toggle" onclick="return toggle('Helper.getUV');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getUV">getUV</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">faceIndex</tt><tt class="py-op">,</tt><tt class="py-param">vertexIndex</tt><tt class="py-op">,</tt><tt class="py-param">perVertice</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getUV-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getUV-expanded"><a name="L1709"></a><tt class="py-lineno">1709</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1710"></a><tt class="py-lineno">1710</tt>  <tt class="py-line">         </tt>
<a name="Helper.setUV"></a><div id="Helper.setUV-def"><a name="L1711"></a><tt class="py-lineno">1711</tt> <a class="py-toggle" href="#" id="Helper.setUV-toggle" onclick="return toggle('Helper.setUV');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#setUV">setUV</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">faceIndex</tt><tt class="py-op">,</tt><tt class="py-param">vertexIndex</tt><tt class="py-op">,</tt><tt class="py-param">uv</tt><tt class="py-op">,</tt><tt class="py-param">perVertice</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.setUV-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.setUV-expanded"><a name="L1712"></a><tt class="py-lineno">1712</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L1713"></a><tt class="py-lineno">1713</tt>  <tt class="py-line"> </tt>
<a name="Helper.makeTexture"></a><div id="Helper.makeTexture-def"><a name="L1714"></a><tt class="py-lineno">1714</tt> <a class="py-toggle" href="#" id="Helper.makeTexture-toggle" onclick="return toggle('Helper.makeTexture');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#makeTexture">makeTexture</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">img</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">colors</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">sizex</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-param">sizey</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L1715"></a><tt class="py-lineno">1715</tt>  <tt class="py-line">                    <tt class="py-param">s</tt><tt class="py-op">=</tt><tt class="py-number">20</tt><tt class="py-op">,</tt><tt class="py-param">draw</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-param">faces</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">invert</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.makeTexture-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.makeTexture-expanded"><a name="L1716"></a><tt class="py-lineno">1716</tt>  <tt class="py-line">        <tt class="py-name">invert</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L1717"></a><tt class="py-lineno">1717</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">img</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">draw</tt><tt class="py-op">:</tt> </tt>
<a name="L1718"></a><tt class="py-lineno">1718</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">Image</tt> </tt>
<a name="L1719"></a><tt class="py-lineno">1719</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">Image</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-string">"RGB"</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1720"></a><tt class="py-lineno">1720</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">draw</tt> <tt class="py-keyword">and</tt> <tt id="link-125" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-125', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">:</tt> </tt>
<a name="L1721"></a><tt class="py-lineno">1721</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">zeros</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1722"></a><tt class="py-lineno">1722</tt>  <tt class="py-line">            <tt class="py-comment">#ramp = numpy.ones( (size, n), 'd')</tt> </tt>
<a name="L1723"></a><tt class="py-lineno">1723</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1724"></a><tt class="py-lineno">1724</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">ImageDraw</tt> </tt>
<a name="L1725"></a><tt class="py-lineno">1725</tt>  <tt class="py-line">            <tt class="py-name">imdraw</tt> <tt class="py-op">=</tt> <tt class="py-name">ImageDraw</tt><tt class="py-op">.</tt><tt class="py-name">Draw</tt><tt class="py-op">(</tt><tt class="py-name">img</tt><tt class="py-op">)</tt> </tt>
<a name="L1726"></a><tt class="py-lineno">1726</tt>  <tt class="py-line">        <tt class="py-comment">#object handling</tt> </tt>
<a name="L1727"></a><tt class="py-lineno">1727</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">faces</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-op">:</tt> </tt>
<a name="L1728"></a><tt class="py-lineno">1728</tt>  <tt class="py-line">            <tt class="py-name">faces</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-126" class="py-name" targets="Method upy.hostHelper.Helper.getFaces()=upy.hostHelper.Helper-class.html#getFaces"><a title="upy.hostHelper.Helper.getFaces" class="py-name" href="#" onclick="return doclink('link-126', 'getFaces', 'link-126');">getFaces</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L1729"></a><tt class="py-lineno">1729</tt>  <tt class="py-line">        <tt class="py-name">order</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1730"></a><tt class="py-lineno">1730</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">host</tt> <tt class="py-op">!=</tt> <tt class="py-string">'c4d'</tt><tt class="py-op">:</tt> </tt>
<a name="L1731"></a><tt class="py-lineno">1731</tt>  <tt class="py-line">            <tt class="py-name">invert</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt> </tt>
<a name="L1732"></a><tt class="py-lineno">1732</tt>  <tt class="py-line">            <tt class="py-name">order</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L1733"></a><tt class="py-lineno">1733</tt>  <tt class="py-line">        <tt id="link-127" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-127', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L1734"></a><tt class="py-lineno">1734</tt>  <tt class="py-line">        <tt id="link-128" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-128', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L1735"></a><tt class="py-lineno">1735</tt>  <tt class="py-line">        <tt class="py-name">s</tt><tt class="py-op">=</tt><tt class="py-name">s</tt> </tt>
<a name="L1736"></a><tt class="py-lineno">1736</tt>  <tt class="py-line">        <tt class="py-name">uvindex</tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L1737"></a><tt class="py-lineno">1737</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-129" class="py-name" targets="Method upy.hostHelper.Helper.resetProgressBar()=upy.hostHelper.Helper-class.html#resetProgressBar"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-129', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1738"></a><tt class="py-lineno">1738</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
<a name="L1739"></a><tt class="py-lineno">1739</tt>  <tt class="py-line">            <tt class="py-name">xys</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-130" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-130', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-131" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-131', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-132" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-132', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-133" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-133', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-134" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-134', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-135" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-135', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L1740"></a><tt class="py-lineno">1740</tt>  <tt class="py-line">            <tt id="link-136" class="py-name"><a title="upy.hostHelper.Helper.box" class="py-name" href="#" onclick="return doclink('link-136', 'box', 'link-67');">box</a></tt><tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-137" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-137', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-138" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-138', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-139" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-139', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-140" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-140', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L1741"></a><tt class="py-lineno">1741</tt>  <tt class="py-line">            <tt class="py-name">c1</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-141" class="py-name" targets="Method upy.hostHelper.Helper.convertColor()=upy.hostHelper.Helper-class.html#convertColor"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-141', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-142" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-142', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1742"></a><tt class="py-lineno">1742</tt>  <tt class="py-line">            <tt class="py-name">c2</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-143" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-143', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-144" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-144', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1743"></a><tt class="py-lineno">1743</tt>  <tt class="py-line">            <tt class="py-name">c3</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-145" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-145', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-146" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-146', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1744"></a><tt class="py-lineno">1744</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1745"></a><tt class="py-lineno">1745</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-147" class="py-name" targets="Method upy.hostHelper.Helper.drawGradientLine()=upy.hostHelper.Helper-class.html#drawGradientLine"><a title="upy.hostHelper.Helper.drawGradientLine" class="py-name" href="#" onclick="return doclink('link-147', 'drawGradientLine', 'link-147');">drawGradientLine</a></tt><tt class="py-op">(</tt><tt class="py-name">imdraw</tt><tt class="py-op">,</tt><tt class="py-name">c1</tt><tt class="py-op">,</tt><tt class="py-name">c2</tt><tt class="py-op">,</tt><tt class="py-name">c3</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">)</tt> </tt>
<a name="L1746"></a><tt class="py-lineno">1746</tt>  <tt class="py-line">                <tt class="py-comment">#self.drawPtCol(imdraw,numpy.array([c1,c2,c3]),xys,debug=0)</tt> </tt>
<a name="L1747"></a><tt class="py-lineno">1747</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1748"></a><tt class="py-lineno">1748</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt id="link-148" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-148', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">:</tt> </tt>
<a name="L1749"></a><tt class="py-lineno">1749</tt>  <tt class="py-line">                    <tt class="py-name">img</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-149" class="py-name" targets="Method upy.hostHelper.Helper.fillTriangleColor()=upy.hostHelper.Helper-class.html#fillTriangleColor"><a title="upy.hostHelper.Helper.fillTriangleColor" class="py-name" href="#" onclick="return doclink('link-149', 'fillTriangleColor', 'link-149');">fillTriangleColor</a></tt><tt class="py-op">(</tt><tt class="py-name">img</tt><tt class="py-op">,</tt><tt class="py-name">c1</tt><tt class="py-op">,</tt><tt class="py-name">c2</tt><tt class="py-op">,</tt><tt class="py-name">c3</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">)</tt> </tt>
<a name="L1750"></a><tt class="py-lineno">1750</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">invert</tt> <tt class="py-op">:</tt> </tt>
<a name="L1751"></a><tt class="py-lineno">1751</tt>  <tt class="py-line">                <tt class="py-name">uv</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-150" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-150', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-151" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-151', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1752"></a><tt class="py-lineno">1752</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-152" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-152', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-153" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-153', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1753"></a><tt class="py-lineno">1753</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-154" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-154', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-155" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-155', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1754"></a><tt class="py-lineno">1754</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-156" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-156', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-157" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-157', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt>                 </tt>
<a name="L1755"></a><tt class="py-lineno">1755</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1756"></a><tt class="py-lineno">1756</tt>  <tt class="py-line">                <tt class="py-name">uv</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-158" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-158', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-159" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-159', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1757"></a><tt class="py-lineno">1757</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-160" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-160', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-161" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-161', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1758"></a><tt class="py-lineno">1758</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-162" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-162', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-163" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-163', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1759"></a><tt class="py-lineno">1759</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-164" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-164', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-165" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-165', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1760"></a><tt class="py-lineno">1760</tt>  <tt class="py-line">            <tt class="py-name">uvindex</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-166" class="py-name" targets="Method upy.hostHelper.Helper.setUV()=upy.hostHelper.Helper-class.html#setUV"><a title="upy.hostHelper.Helper.setUV" class="py-name" href="#" onclick="return doclink('link-166', 'setUV', 'link-166');">setUV</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">,</tt><tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-name">uv</tt><tt class="py-op">,</tt><tt class="py-name">perVertice</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">uvid</tt><tt class="py-op">=</tt><tt class="py-name">uvindex</tt><tt class="py-op">)</tt><tt class="py-comment">#perFaces give 3-4 uv</tt> </tt>
<a name="L1761"></a><tt class="py-lineno">1761</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-167" class="py-name" targets="Method upy.hostHelper.Helper.progressBar()=upy.hostHelper.Helper-class.html#progressBar"><a title="upy.hostHelper.Helper.progressBar" class="py-name" href="#" onclick="return doclink('link-167', 'progressBar', 'link-167');">progressBar</a></tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">"faces "</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">"/"</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">" done"</tt><tt class="py-op">)</tt> </tt>
<a name="L1762"></a><tt class="py-lineno">1762</tt>  <tt class="py-line">            <tt id="link-168" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-168', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt> <tt id="link-169" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-169', 'x', 'link-20');">x</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> </tt>
<a name="L1763"></a><tt class="py-lineno">1763</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-170" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-170', 'x', 'link-20');">x</a></tt> <tt class="py-op">&gt;=</tt><tt class="py-name">sizex</tt> <tt class="py-keyword">or</tt> <tt id="link-171" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-171', 'x', 'link-20');">x</a></tt> <tt class="py-op">+</tt><tt class="py-name">s</tt> <tt class="py-op">&gt;=</tt><tt class="py-name">sizex</tt><tt class="py-op">:</tt> </tt>
<a name="L1764"></a><tt class="py-lineno">1764</tt>  <tt class="py-line">                <tt id="link-172" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-172', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L1765"></a><tt class="py-lineno">1765</tt>  <tt class="py-line">                <tt id="link-173" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-173', 'y', 'link-21');">y</a></tt> <tt class="py-op">=</tt> <tt id="link-174" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-174', 'y', 'link-21');">y</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> </tt>
<a name="L1766"></a><tt class="py-lineno">1766</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1767"></a><tt class="py-lineno">1767</tt>  <tt class="py-line">            <tt class="py-name">img</tt><tt class="py-op">.</tt><tt class="py-name">save</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1768"></a><tt class="py-lineno">1768</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1769"></a><tt class="py-lineno">1769</tt>  <tt class="py-line">            <tt class="py-comment">#what to do with the array - &gt; build image using host or PIL</tt> </tt>
<a name="L1770"></a><tt class="py-lineno">1770</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#n=int(len(img)/(sizex*sizey))</tt> </tt>
<a name="L1771"></a><tt class="py-lineno">1771</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#img=img.reshape(sizex,sizey,n)</tt> </tt>
<a name="L1772"></a><tt class="py-lineno">1772</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">mode</tt> <tt class="py-op">=</tt> <tt class="py-string">"RGB"</tt> </tt>
<a name="L1773"></a><tt class="py-lineno">1773</tt>  <tt class="py-line">            <tt class="py-comment">#else : mode = "RGBA"</tt> </tt>
<a name="L1774"></a><tt class="py-lineno">1774</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">mode</tt><tt class="py-op">)</tt> </tt>
<a name="L1775"></a><tt class="py-lineno">1775</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">Image</tt> </tt>
<a name="L1776"></a><tt class="py-lineno">1776</tt>  <tt class="py-line">            <tt class="py-name">pilImage</tt> <tt class="py-op">=</tt> <tt class="py-name">Image</tt><tt class="py-op">.</tt><tt class="py-name">fromstring</tt><tt class="py-op">(</tt><tt class="py-name">mode</tt><tt class="py-op">,</tt><tt class="py-name">img</tt><tt class="py-op">.</tt><tt class="py-name">shape</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">:</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">img</tt><tt class="py-op">.</tt><tt class="py-name">tostring</tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1777"></a><tt class="py-lineno">1777</tt>  <tt class="py-line">            <tt class="py-comment">#img=numpy.array(img)</tt> </tt>
<a name="L1778"></a><tt class="py-lineno">1778</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#pilImage = Image.fromarray(img, mode)</tt> </tt>
<a name="L1779"></a><tt class="py-lineno">1779</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">pilImage</tt><tt class="py-op">.</tt><tt class="py-name">save</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1780"></a><tt class="py-lineno">1780</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-175" class="py-name"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-175', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1781"></a><tt class="py-lineno">1781</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">img</tt> </tt>
</div><a name="L1782"></a><tt class="py-lineno">1782</tt>  <tt class="py-line">         </tt>
<a name="Helper.makeTextureM"></a><div id="Helper.makeTextureM-def"><a name="L1783"></a><tt class="py-lineno">1783</tt> <a class="py-toggle" href="#" id="Helper.makeTextureM-toggle" onclick="return toggle('Helper.makeTextureM');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#makeTextureM">makeTextureM</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">img</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">colors</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">sizex</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-param">sizey</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L1784"></a><tt class="py-lineno">1784</tt>  <tt class="py-line">                    <tt class="py-param">s</tt><tt class="py-op">=</tt><tt class="py-number">20</tt><tt class="py-op">,</tt><tt class="py-param">draw</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-param">faces</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L1785"></a><tt class="py-lineno">1785</tt>  <tt class="py-line">                    <tt class="py-param">invert</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.makeTextureM-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.makeTextureM-expanded"><a name="L1786"></a><tt class="py-lineno">1786</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">img</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">draw</tt><tt class="py-op">:</tt> </tt>
<a name="L1787"></a><tt class="py-lineno">1787</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">Image</tt> </tt>
<a name="L1788"></a><tt class="py-lineno">1788</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">Image</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-string">"RGB"</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1789"></a><tt class="py-lineno">1789</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">draw</tt> <tt class="py-keyword">and</tt> <tt id="link-176" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-176', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">:</tt> </tt>
<a name="L1790"></a><tt class="py-lineno">1790</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">zeros</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1791"></a><tt class="py-lineno">1791</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1792"></a><tt class="py-lineno">1792</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">ImageDraw</tt> </tt>
<a name="L1793"></a><tt class="py-lineno">1793</tt>  <tt class="py-line">            <tt class="py-name">imdraw</tt> <tt class="py-op">=</tt> <tt class="py-name">ImageDraw</tt><tt class="py-op">.</tt><tt class="py-name">Draw</tt><tt class="py-op">(</tt><tt class="py-name">img</tt><tt class="py-op">)</tt> </tt>
<a name="L1794"></a><tt class="py-lineno">1794</tt>  <tt class="py-line">        <tt class="py-comment">#object handling</tt> </tt>
<a name="L1795"></a><tt class="py-lineno">1795</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">faces</tt><tt class="py-op">==</tt><tt class="py-name">None</tt><tt class="py-op">:</tt> </tt>
<a name="L1796"></a><tt class="py-lineno">1796</tt>  <tt class="py-line">            <tt class="py-name">faces</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-177" class="py-name"><a title="upy.hostHelper.Helper.getFaces" class="py-name" href="#" onclick="return doclink('link-177', 'getFaces', 'link-126');">getFaces</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L1797"></a><tt class="py-lineno">1797</tt>  <tt class="py-line">        <tt id="link-178" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-178', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L1798"></a><tt class="py-lineno">1798</tt>  <tt class="py-line">        <tt id="link-179" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-179', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-number">0</tt> </tt>
<a name="L1799"></a><tt class="py-lineno">1799</tt>  <tt class="py-line">        <tt class="py-name">s</tt><tt class="py-op">=</tt><tt class="py-name">s</tt> </tt>
<a name="L1800"></a><tt class="py-lineno">1800</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-180" class="py-name"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-180', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1801"></a><tt class="py-lineno">1801</tt>  <tt class="py-line">        <tt class="py-name">uv</tt><tt class="py-op">=</tt><tt class="py-op">{</tt><tt class="py-op">}</tt> </tt>
<a name="L1802"></a><tt class="py-lineno">1802</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
<a name="L1803"></a><tt class="py-lineno">1803</tt>  <tt class="py-line">            <tt class="py-name">xys</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-181" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-181', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-182" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-182', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-183" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-183', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-184" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-184', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-185" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-185', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-186" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-186', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L1804"></a><tt class="py-lineno">1804</tt>  <tt class="py-line">            <tt id="link-187" class="py-name"><a title="upy.hostHelper.Helper.box" class="py-name" href="#" onclick="return doclink('link-187', 'box', 'link-67');">box</a></tt><tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-188" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-188', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt id="link-189" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-189', 'y', 'link-21');">y</a></tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-190" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-190', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">,</tt><tt id="link-191" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-191', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">)</tt><tt class="py-op">]</tt> </tt>
<a name="L1805"></a><tt class="py-lineno">1805</tt>  <tt class="py-line">            <tt class="py-name">c1</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-192" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-192', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-193" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-193', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1806"></a><tt class="py-lineno">1806</tt>  <tt class="py-line">            <tt class="py-name">c2</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-194" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-194', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-195" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-195', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1807"></a><tt class="py-lineno">1807</tt>  <tt class="py-line">            <tt class="py-name">c3</tt><tt class="py-op">=</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-196" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-196', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-197" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-197', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1808"></a><tt class="py-lineno">1808</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1809"></a><tt class="py-lineno">1809</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-198" class="py-name"><a title="upy.hostHelper.Helper.drawGradientLine" class="py-name" href="#" onclick="return doclink('link-198', 'drawGradientLine', 'link-147');">drawGradientLine</a></tt><tt class="py-op">(</tt><tt class="py-name">imdraw</tt><tt class="py-op">,</tt><tt class="py-name">c1</tt><tt class="py-op">,</tt><tt class="py-name">c2</tt><tt class="py-op">,</tt><tt class="py-name">c3</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">)</tt> </tt>
<a name="L1810"></a><tt class="py-lineno">1810</tt>  <tt class="py-line">                <tt class="py-comment">#self.drawPtCol(imdraw,numpy.array([c1,c2,c3]),xys,debug=0)</tt> </tt>
<a name="L1811"></a><tt class="py-lineno">1811</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">if</tt> <tt class="py-name">invert</tt> <tt class="py-op">:</tt> </tt>
<a name="L1812"></a><tt class="py-lineno">1812</tt>  <tt class="py-line">                <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-199" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-199', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-200" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-200', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1813"></a><tt class="py-lineno">1813</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-201" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-201', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-202" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-202', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1814"></a><tt class="py-lineno">1814</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-203" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-203', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-204" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-204', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1815"></a><tt class="py-lineno">1815</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-205" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-205', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt id="link-206" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-206', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt>                 </tt>
<a name="L1816"></a><tt class="py-lineno">1816</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1817"></a><tt class="py-lineno">1817</tt>  <tt class="py-line">                <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-207" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-207', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-208" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-208', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1818"></a><tt class="py-lineno">1818</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-209" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-209', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-210" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-210', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt>  </tt>
<a name="L1819"></a><tt class="py-lineno">1819</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-211" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-211', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-212" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-212', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> </tt>
<a name="L1820"></a><tt class="py-lineno">1820</tt>  <tt class="py-line">                    <tt class="py-op">[</tt><tt class="py-op">(</tt><tt id="link-213" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-213', 'x', 'link-20');">x</a></tt><tt class="py-op">+</tt><tt class="py-name">s</tt><tt class="py-op">-</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt id="link-214" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-214', 'y', 'link-21');">y</a></tt><tt class="py-op">+</tt><tt class="py-number">2</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">sizey</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1821"></a><tt class="py-lineno">1821</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-215" class="py-name"><a title="upy.hostHelper.Helper.progressBar" class="py-name" href="#" onclick="return doclink('link-215', 'progressBar', 'link-167');">progressBar</a></tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">" draw faces "</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">" done"</tt><tt class="py-op">)</tt> </tt>
<a name="L1822"></a><tt class="py-lineno">1822</tt>  <tt class="py-line">            <tt id="link-216" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-216', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt> <tt id="link-217" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-217', 'x', 'link-20');">x</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> </tt>
<a name="L1823"></a><tt class="py-lineno">1823</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt id="link-218" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-218', 'x', 'link-20');">x</a></tt> <tt class="py-op">&gt;=</tt><tt class="py-name">sizex</tt> <tt class="py-keyword">or</tt> <tt id="link-219" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-219', 'x', 'link-20');">x</a></tt> <tt class="py-op">+</tt><tt class="py-name">s</tt> <tt class="py-op">&gt;=</tt><tt class="py-name">sizex</tt><tt class="py-op">:</tt> </tt>
<a name="L1824"></a><tt class="py-lineno">1824</tt>  <tt class="py-line">                <tt id="link-220" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-220', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> </tt>
<a name="L1825"></a><tt class="py-lineno">1825</tt>  <tt class="py-line">                <tt id="link-221" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-221', 'y', 'link-21');">y</a></tt> <tt class="py-op">=</tt> <tt id="link-222" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-222', 'y', 'link-21');">y</a></tt> <tt class="py-op">+</tt> <tt class="py-name">s</tt> </tt>
<a name="L1826"></a><tt class="py-lineno">1826</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-223" class="py-name" targets="Method upy.hostHelper.Helper.setUVs()=upy.hostHelper.Helper-class.html#setUVs"><a title="upy.hostHelper.Helper.setUVs" class="py-name" href="#" onclick="return doclink('link-223', 'setUVs', 'link-223');">setUVs</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">)</tt> </tt>
<a name="L1827"></a><tt class="py-lineno">1827</tt>  <tt class="py-line">        <tt class="py-name">img</tt><tt class="py-op">.</tt><tt class="py-name">save</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1828"></a><tt class="py-lineno">1828</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-224" class="py-name"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-224', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1829"></a><tt class="py-lineno">1829</tt>  <tt class="py-line">         </tt>
<a name="Helper.makeTextureFromUVs"></a><div id="Helper.makeTextureFromUVs-def"><a name="L1830"></a><tt class="py-lineno">1830</tt> <a class="py-toggle" href="#" id="Helper.makeTextureFromUVs-toggle" onclick="return toggle('Helper.makeTextureFromUVs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#makeTextureFromUVs">makeTextureFromUVs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">img</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">colors</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L1831"></a><tt class="py-lineno">1831</tt>  <tt class="py-line">                    <tt class="py-param">sizex</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-param">sizey</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> </tt>
<a name="L1832"></a><tt class="py-lineno">1832</tt>  <tt class="py-line">                    <tt class="py-param">s</tt><tt class="py-op">=</tt><tt class="py-number">20</tt><tt class="py-op">,</tt><tt class="py-param">draw</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt> </tt>
<a name="L1833"></a><tt class="py-lineno">1833</tt>  <tt class="py-line">                    <tt class="py-param">invert</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.makeTextureFromUVs-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.makeTextureFromUVs-expanded"><a name="L1834"></a><tt class="py-lineno">1834</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">img</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">and</tt> <tt class="py-name">draw</tt><tt class="py-op">:</tt> </tt>
<a name="L1835"></a><tt class="py-lineno">1835</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">Image</tt> </tt>
<a name="L1836"></a><tt class="py-lineno">1836</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">Image</tt><tt class="py-op">.</tt><tt class="py-name">new</tt><tt class="py-op">(</tt><tt class="py-string">"RGB"</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">,</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1837"></a><tt class="py-lineno">1837</tt>  <tt class="py-line">        <tt class="py-keyword">elif</tt> <tt class="py-keyword">not</tt> <tt class="py-name">draw</tt> <tt class="py-keyword">and</tt> <tt id="link-225" class="py-name"><a title="upy.hostHelper.usenumpy" class="py-name" href="#" onclick="return doclink('link-225', 'usenumpy', 'link-0');">usenumpy</a></tt> <tt class="py-op">:</tt> </tt>
<a name="L1838"></a><tt class="py-lineno">1838</tt>  <tt class="py-line">            <tt class="py-name">img</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">zeros</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizex</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">sizey</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1839"></a><tt class="py-lineno">1839</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">draw</tt> <tt class="py-op">:</tt> </tt>
<a name="L1840"></a><tt class="py-lineno">1840</tt>  <tt class="py-line">            <tt class="py-keyword">import</tt> <tt class="py-name">ImageDraw</tt> </tt>
<a name="L1841"></a><tt class="py-lineno">1841</tt>  <tt class="py-line">            <tt class="py-name">imdraw</tt> <tt class="py-op">=</tt> <tt class="py-name">ImageDraw</tt><tt class="py-op">.</tt><tt class="py-name">Draw</tt><tt class="py-op">(</tt><tt class="py-name">img</tt><tt class="py-op">)</tt> </tt>
<a name="L1842"></a><tt class="py-lineno">1842</tt>  <tt class="py-line">        <tt class="py-name">uvs</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1843"></a><tt class="py-lineno">1843</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">host</tt> <tt class="py-op">==</tt> <tt class="py-string">'maya'</tt><tt class="py-op">:</tt> </tt>
<a name="L1844"></a><tt class="py-lineno">1844</tt>  <tt class="py-line">            <tt class="py-name">invert</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt>         </tt>
<a name="L1845"></a><tt class="py-lineno">1845</tt>  <tt class="py-line">        <tt class="py-name">faces</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-226" class="py-name"><a title="upy.hostHelper.Helper.getFaces" class="py-name" href="#" onclick="return doclink('link-226', 'getFaces', 'link-126');">getFaces</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L1846"></a><tt class="py-lineno">1846</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-227" class="py-name"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-227', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1847"></a><tt class="py-lineno">1847</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">faceindex</tt><tt class="py-op">,</tt><tt class="py-name">f</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt> <tt class="py-op">:</tt> </tt>
<a name="L1848"></a><tt class="py-lineno">1848</tt>  <tt class="py-line">            <tt class="py-name">uv</tt><tt class="py-op">=</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-228" class="py-name" targets="Method upy.hostHelper.Helper.getUV()=upy.hostHelper.Helper-class.html#getUV"><a title="upy.hostHelper.Helper.getUV" class="py-name" href="#" onclick="return doclink('link-228', 'getUV', 'link-228');">getUV</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">,</tt><tt class="py-name">faceindex</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-name">perVertice</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt> </tt>
<a name="L1849"></a><tt class="py-lineno">1849</tt>  <tt class="py-line"><tt class="py-comment">#            print "uv ",faceindex,uv,f</tt> </tt>
<a name="L1850"></a><tt class="py-lineno">1850</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">uvs</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1851"></a><tt class="py-lineno">1851</tt>  <tt class="py-line">            <tt class="py-name">color</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1852"></a><tt class="py-lineno">1852</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">f</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">:</tt> <tt class="py-comment"># 3 vertex</tt> </tt>
<a name="L1853"></a><tt class="py-lineno">1853</tt>  <tt class="py-line">                <tt class="py-comment">#print "vi",itPoly.vertexIndex(i)</tt> </tt>
<a name="L1854"></a><tt class="py-lineno">1854</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">vertexindex</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L1855"></a><tt class="py-lineno">1855</tt>  <tt class="py-line">                <tt class="py-name">color</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-229" class="py-name"><a title="upy.hostHelper.Helper.convertColor" class="py-name" href="#" onclick="return doclink('link-229', 'convertColor', 'link-141');">convertColor</a></tt><tt class="py-op">(</tt><tt id="link-230" class="py-name"><a title="upy.colors" class="py-name" href="#" onclick="return doclink('link-230', 'colors', 'link-4');">colors</a></tt><tt class="py-op">[</tt><tt class="py-name">vertexindex</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1856"></a><tt class="py-lineno">1856</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">invert</tt> <tt class="py-op">:</tt> </tt>
<a name="L1857"></a><tt class="py-lineno">1857</tt>  <tt class="py-line">                    <tt class="py-name">uvs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt> <tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-name">sizex</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt><tt class="py-comment">#order?</tt> </tt>
<a name="L1858"></a><tt class="py-lineno">1858</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1859"></a><tt class="py-lineno">1859</tt>  <tt class="py-line">                    <tt class="py-name">uvs</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-op">[</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">sizex</tt><tt class="py-op">,</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">*</tt><tt class="py-name">sizex</tt><tt class="py-op">]</tt> <tt class="py-op">)</tt><tt class="py-comment">#order?</tt> </tt>
<a name="L1860"></a><tt class="py-lineno">1860</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-231" class="py-name" targets="Method upy.hostHelper.Helper.drawPtCol()=upy.hostHelper.Helper-class.html#drawPtCol"><a title="upy.hostHelper.Helper.drawPtCol" class="py-name" href="#" onclick="return doclink('link-231', 'drawPtCol', 'link-231');">drawPtCol</a></tt><tt class="py-op">(</tt><tt class="py-name">imdraw</tt><tt class="py-op">,</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">uvs</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">debug</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt> </tt>
<a name="L1861"></a><tt class="py-lineno">1861</tt>  <tt class="py-line">            <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-232" class="py-name"><a title="upy.hostHelper.Helper.progressBar" class="py-name" href="#" onclick="return doclink('link-232', 'progressBar', 'link-167');">progressBar</a></tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">faceindex</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">faces</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-string">"faces "</tt><tt class="py-op">+</tt><tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">faceindex</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-string">" done"</tt><tt class="py-op">)</tt> </tt>
<a name="L1862"></a><tt class="py-lineno">1862</tt>  <tt class="py-line">        <tt class="py-name">img</tt><tt class="py-op">.</tt><tt class="py-name">save</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt> </tt>
<a name="L1863"></a><tt class="py-lineno">1863</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-233" class="py-name"><a title="upy.hostHelper.Helper.resetProgressBar" class="py-name" href="#" onclick="return doclink('link-233', 'resetProgressBar', 'link-129');">resetProgressBar</a></tt><tt class="py-op">(</tt><tt class="py-number">0</tt><tt class="py-op">)</tt>      </tt>
</div><a name="L1864"></a><tt class="py-lineno">1864</tt>  <tt class="py-line"> </tt>
<a name="Helper.fillTriangleColor"></a><div id="Helper.fillTriangleColor-def"><a name="L1865"></a><tt class="py-lineno">1865</tt> <a class="py-toggle" href="#" id="Helper.fillTriangleColor-toggle" onclick="return toggle('Helper.fillTriangleColor');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#fillTriangleColor">fillTriangleColor</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">array</tt><tt class="py-op">,</tt><tt class="py-param">col1</tt><tt class="py-op">,</tt><tt class="py-param">col2</tt><tt class="py-op">,</tt><tt class="py-param">col3</tt><tt class="py-op">,</tt><tt class="py-param">xys</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.fillTriangleColor-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.fillTriangleColor-expanded"><a name="L1866"></a><tt class="py-lineno">1866</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1867"></a><tt class="py-lineno">1867</tt>  <tt class="py-line">            <tt class="py-name">a</tt><tt class="py-op">=</tt><tt class="py-name">i</tt><tt class="py-op">/</tt><tt class="py-number">20.</tt> </tt>
<a name="L1868"></a><tt class="py-lineno">1868</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">j</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1869"></a><tt class="py-lineno">1869</tt>  <tt class="py-line">                <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">j</tt><tt class="py-op">/</tt><tt class="py-number">20.</tt> </tt>
<a name="L1870"></a><tt class="py-lineno">1870</tt>  <tt class="py-line">                <tt class="py-name">xy</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">j</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">i</tt><tt class="py-op">)</tt> </tt>
<a name="L1871"></a><tt class="py-lineno">1871</tt>  <tt class="py-line">                <tt class="py-name">xcol</tt> <tt class="py-op">=</tt> <tt class="py-name">col1</tt><tt class="py-op">+</tt><tt class="py-name">b</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">col3</tt><tt class="py-op">-</tt><tt class="py-name">col1</tt><tt class="py-op">)</tt> </tt>
<a name="L1872"></a><tt class="py-lineno">1872</tt>  <tt class="py-line">                <tt class="py-name">ycol</tt> <tt class="py-op">=</tt> <tt class="py-name">xcol</tt><tt class="py-op">+</tt><tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">col2</tt><tt class="py-op">-</tt><tt class="py-name">xcol</tt><tt class="py-op">)</tt> </tt>
<a name="L1873"></a><tt class="py-lineno">1873</tt>  <tt class="py-line">                <tt class="py-name">array</tt><tt class="py-op">[</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">j</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1874"></a><tt class="py-lineno">1874</tt>  <tt class="py-line">                <tt class="py-comment">#imdraw.point((xys[0][0]+j,xys[0][1]+i),fill=(ycol[0],ycol[1],ycol[2]))</tt> </tt>
<a name="L1875"></a><tt class="py-lineno">1875</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">array</tt> </tt>
</div><a name="L1876"></a><tt class="py-lineno">1876</tt>  <tt class="py-line">         </tt>
<a name="Helper.drawGradientLine"></a><div id="Helper.drawGradientLine-def"><a name="L1877"></a><tt class="py-lineno">1877</tt> <a class="py-toggle" href="#" id="Helper.drawGradientLine-toggle" onclick="return toggle('Helper.drawGradientLine');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#drawGradientLine">drawGradientLine</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">imdraw</tt><tt class="py-op">,</tt><tt class="py-param">col1</tt><tt class="py-op">,</tt><tt class="py-param">col2</tt><tt class="py-op">,</tt><tt class="py-param">col3</tt><tt class="py-op">,</tt><tt class="py-param">xys</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.drawGradientLine-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.drawGradientLine-expanded"><a name="L1878"></a><tt class="py-lineno">1878</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">col1</tt> <tt class="py-keyword">is</tt> <tt class="py-name">col2</tt> <tt class="py-keyword">and</tt> <tt class="py-name">col2</tt> <tt class="py-keyword">is</tt> <tt class="py-name">col3</tt> <tt class="py-op">:</tt> </tt>
<a name="L1879"></a><tt class="py-lineno">1879</tt>  <tt class="py-line">            <tt class="py-name">imdraw</tt><tt class="py-op">.</tt><tt class="py-name">rectangle</tt><tt class="py-op">(</tt><tt class="py-op">[</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">fill</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">col1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">col1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt> <tt class="py-name">col1</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1880"></a><tt class="py-lineno">1880</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L1881"></a><tt class="py-lineno">1881</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1882"></a><tt class="py-lineno">1882</tt>  <tt class="py-line">                <tt class="py-name">a</tt><tt class="py-op">=</tt><tt class="py-name">i</tt><tt class="py-op">/</tt><tt class="py-number">20.</tt> </tt>
<a name="L1883"></a><tt class="py-lineno">1883</tt>  <tt class="py-line">                <tt class="py-keyword">for</tt> <tt class="py-name">j</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">20</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1884"></a><tt class="py-lineno">1884</tt>  <tt class="py-line">                    <tt class="py-name">b</tt> <tt class="py-op">=</tt> <tt class="py-name">j</tt><tt class="py-op">/</tt><tt class="py-number">20.</tt> </tt>
<a name="L1885"></a><tt class="py-lineno">1885</tt>  <tt class="py-line">                    <tt class="py-name">xy</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">j</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">i</tt><tt class="py-op">)</tt> </tt>
<a name="L1886"></a><tt class="py-lineno">1886</tt>  <tt class="py-line">                    <tt class="py-name">xcol</tt> <tt class="py-op">=</tt> <tt class="py-name">col1</tt><tt class="py-op">+</tt><tt class="py-name">b</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">col3</tt><tt class="py-op">-</tt><tt class="py-name">col1</tt><tt class="py-op">)</tt> </tt>
<a name="L1887"></a><tt class="py-lineno">1887</tt>  <tt class="py-line">                    <tt class="py-name">ycol</tt> <tt class="py-op">=</tt> <tt class="py-name">xcol</tt><tt class="py-op">+</tt><tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">col2</tt><tt class="py-op">-</tt><tt class="py-name">xcol</tt><tt class="py-op">)</tt> </tt>
<a name="L1888"></a><tt class="py-lineno">1888</tt>  <tt class="py-line">                    <tt class="py-name">imdraw</tt><tt class="py-op">.</tt><tt class="py-name">point</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">j</tt><tt class="py-op">,</tt><tt class="py-name">xys</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">i</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">fill</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
</div><a name="L1889"></a><tt class="py-lineno">1889</tt>  <tt class="py-line">     </tt>
<a name="L1890"></a><tt class="py-lineno">1890</tt>  <tt class="py-line"> </tt>
<a name="Helper.drawPtCol"></a><div id="Helper.drawPtCol-def"><a name="L1891"></a><tt class="py-lineno">1891</tt> <a class="py-toggle" href="#" id="Helper.drawPtCol-toggle" onclick="return toggle('Helper.drawPtCol');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#drawPtCol">drawPtCol</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">imdraw</tt><tt class="py-op">,</tt><tt class="py-param">color</tt><tt class="py-op">,</tt><tt class="py-param">uv</tt><tt class="py-op">,</tt><tt class="py-param">debug</tt><tt class="py-op">=</tt><tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.drawPtCol-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.drawPtCol-expanded"><a name="L1892"></a><tt class="py-lineno">1892</tt>  <tt class="py-line">        <tt class="py-comment">#uv is the 3 vertex coordinate in UV </tt> </tt>
<a name="L1893"></a><tt class="py-lineno">1893</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1894"></a><tt class="py-lineno">1894</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">)</tt> </tt>
<a name="L1895"></a><tt class="py-lineno">1895</tt>  <tt class="py-line"><tt class="py-comment">#        uv=extendUV(uv)</tt> </tt>
<a name="L1896"></a><tt class="py-lineno">1896</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">uv</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">)</tt> </tt>
<a name="L1897"></a><tt class="py-lineno">1897</tt>  <tt class="py-line">        <tt class="py-name">u</tt><tt class="py-op">=</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1898"></a><tt class="py-lineno">1898</tt>  <tt class="py-line">        <tt class="py-name">v</tt><tt class="py-op">=</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1899"></a><tt class="py-lineno">1899</tt>  <tt class="py-line">        <tt class="py-name">a</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L1900"></a><tt class="py-lineno">1900</tt>  <tt class="py-line">        <tt class="py-comment">#color = [c0,c1,c2] </tt> </tt>
<a name="L1901"></a><tt class="py-lineno">1901</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">distu</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1902"></a><tt class="py-lineno">1902</tt>  <tt class="py-line">        <tt class="py-name">distv</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-op">-</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0.</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1903"></a><tt class="py-lineno">1903</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt><tt class="py-comment">#points</tt> </tt>
<a name="L1904"></a><tt class="py-lineno">1904</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">j</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-number">3</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1905"></a><tt class="py-lineno">1905</tt>  <tt class="py-line"><tt class="py-comment">#                print i,j</tt> </tt>
<a name="L1906"></a><tt class="py-lineno">1906</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">distu</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1907"></a><tt class="py-lineno">1907</tt>  <tt class="py-line">                <tt class="py-name">distv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">i</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">-</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">j</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1908"></a><tt class="py-lineno">1908</tt>  <tt class="py-line">        <tt class="py-name">order</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L1909"></a><tt class="py-lineno">1909</tt>  <tt class="py-line">    <tt class="py-comment">#    print distu</tt> </tt>
<a name="L1910"></a><tt class="py-lineno">1910</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    print distv</tt> </tt>
<a name="L1911"></a><tt class="py-lineno">1911</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">order</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-234" class="py-name" targets="Method upy.hostHelper.Helper.getOrder()=upy.hostHelper.Helper-class.html#getOrder"><a title="upy.hostHelper.Helper.getOrder" class="py-name" href="#" onclick="return doclink('link-234', 'getOrder', 'link-234');">getOrder</a></tt><tt class="py-op">(</tt><tt class="py-name">distu</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">)</tt> </tt>
<a name="L1912"></a><tt class="py-lineno">1912</tt>  <tt class="py-line">    <tt class="py-comment">#    orderv = getOrder(distv,uv=uv)</tt> </tt>
<a name="L1913"></a><tt class="py-lineno">1913</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">ab</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L1914"></a><tt class="py-lineno">1914</tt>  <tt class="py-line">        <tt class="py-name">ab</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-235" class="py-name" targets="Method upy.hostHelper.Helper.getA()=upy.hostHelper.Helper-class.html#getA"><a title="upy.hostHelper.Helper.getA" class="py-name" href="#" onclick="return doclink('link-235', 'getA', 'link-235');">getA</a></tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1915"></a><tt class="py-lineno">1915</tt>  <tt class="py-line">        <tt class="py-name">ab</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-236" class="py-name"><a title="upy.hostHelper.Helper.getA" class="py-name" href="#" onclick="return doclink('link-236', 'getA', 'link-235');">getA</a></tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1916"></a><tt class="py-lineno">1916</tt>  <tt class="py-line">        <tt class="py-name">ab</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-237" class="py-name"><a title="upy.hostHelper.Helper.getA" class="py-name" href="#" onclick="return doclink('link-237', 'getA', 'link-235');">getA</a></tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1917"></a><tt class="py-lineno">1917</tt>  <tt class="py-line">        <tt class="py-name">uv</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">array</tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">,</tt><tt class="py-name">int</tt><tt class="py-op">)</tt> </tt>
<a name="L1918"></a><tt class="py-lineno">1918</tt>  <tt class="py-line">        <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt>  </tt>
<a name="L1919"></a><tt class="py-lineno">1919</tt>  <tt class="py-line">        <tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1920"></a><tt class="py-lineno">1920</tt>  <tt class="py-line">        <tt class="py-name">up</tt> <tt class="py-op">=</tt> <tt class="py-name">False</tt> </tt>
<a name="L1921"></a><tt class="py-lineno">1921</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">distv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> <tt class="py-op">&lt;=</tt> <tt class="py-number">0</tt> <tt class="py-op">:</tt> </tt>
<a name="L1922"></a><tt class="py-lineno">1922</tt>  <tt class="py-line">            <tt class="py-name">up</tt> <tt class="py-op">=</tt> <tt class="py-name">True</tt><tt class="py-comment">#second pt up</tt> </tt>
<a name="L1923"></a><tt class="py-lineno">1923</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1924"></a><tt class="py-lineno">1924</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">up</tt><tt class="py-op">,</tt><tt class="py-name">distv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1925"></a><tt class="py-lineno">1925</tt>  <tt class="py-line">        <tt class="py-comment">#distu=numpy.array(distu,int)</tt> </tt>
<a name="L1926"></a><tt class="py-lineno">1926</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#distv=numpy.array(distv,int)</tt> </tt>
<a name="L1927"></a><tt class="py-lineno">1927</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">rgu</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1928"></a><tt class="py-lineno">1928</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">u</tt><tt class="py-op">-</tt><tt class="py-number">1</tt> <tt class="py-op">==</tt> <tt class="py-op">-</tt><tt class="py-number">1</tt> <tt class="py-op">:</tt> </tt>
<a name="L1929"></a><tt class="py-lineno">1929</tt>  <tt class="py-line">            <tt class="py-name">rgu</tt> <tt class="py-op">=</tt> <tt class="py-name">rgu</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">:</tt><tt class="py-op">]</tt> </tt>
<a name="L1930"></a><tt class="py-lineno">1930</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1931"></a><tt class="py-lineno">1931</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">rgu</tt><tt class="py-op">)</tt>     </tt>
<a name="L1932"></a><tt class="py-lineno">1932</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"1x "</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L1933"></a><tt class="py-lineno">1933</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"1x "</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">)</tt>  </tt>
<a name="L1934"></a><tt class="py-lineno">1934</tt>  <tt class="py-line">        <tt class="py-name">maxv</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1935"></a><tt class="py-lineno">1935</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-name">v</tt><tt class="py-op">:</tt> </tt>
<a name="L1936"></a><tt class="py-lineno">1936</tt>  <tt class="py-line">           <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">distv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1937"></a><tt class="py-lineno">1937</tt>  <tt class="py-line">           <tt class="py-name">maxv</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1938"></a><tt class="py-lineno">1938</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1939"></a><tt class="py-lineno">1939</tt>  <tt class="py-line">            <tt class="py-name">d</tt><tt class="py-op">=</tt><tt class="py-name">distv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1940"></a><tt class="py-lineno">1940</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">d</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0.</tt> <tt class="py-op">:</tt> </tt>
<a name="L1941"></a><tt class="py-lineno">1941</tt>  <tt class="py-line">            <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">d</tt> <tt class="py-op">*</tt><tt class="py-op">-</tt><tt class="py-number">1</tt> </tt>
<a name="L1942"></a><tt class="py-lineno">1942</tt>  <tt class="py-line">        <tt class="py-name">rgv</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1943"></a><tt class="py-lineno">1943</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1944"></a><tt class="py-lineno">1944</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">maxv</tt><tt class="py-op">,</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt> </tt>
<a name="L1945"></a><tt class="py-lineno">1945</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> <tt class="py-op">:</tt> </tt>
<a name="L1946"></a><tt class="py-lineno">1946</tt>  <tt class="py-line">            <tt class="py-name">rgv</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L1947"></a><tt class="py-lineno">1947</tt>  <tt class="py-line">        <tt class="py-name">ycol</tt> <tt class="py-op">=</tt> <tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt>             </tt>
<a name="L1948"></a><tt class="py-lineno">1948</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1949"></a><tt class="py-lineno">1949</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"draw first point"</tt><tt class="py-op">,</tt><tt class="py-name">order</tt><tt class="py-op">,</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgu</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-comment">#</tt> </tt>
<a name="L1950"></a><tt class="py-lineno">1950</tt>  <tt class="py-line">        <tt class="py-comment">#imdraw.point((u,v),fill=(ycol[0],ycol[1],ycol[2]))</tt> </tt>
<a name="L1951"></a><tt class="py-lineno">1951</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#    print "line eq",ab,order,orderv</tt> </tt>
<a name="L1952"></a><tt class="py-lineno">1952</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">indice1</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt> <tt class="py-comment">#more on right</tt> </tt>
<a name="L1953"></a><tt class="py-lineno">1953</tt>  <tt class="py-line">        <tt class="py-name">indice2</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> <tt class="py-comment">#midlle which can be up/down compare to 1</tt> </tt>
<a name="L1954"></a><tt class="py-lineno">1954</tt>  <tt class="py-line">        <tt id="link-238" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-238', 'x', 'link-20');">x</a></tt><tt class="py-op">=</tt><tt class="py-number">0.</tt> </tt>
<a name="L1955"></a><tt class="py-lineno">1955</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt><tt class="py-op">:</tt> </tt>
<a name="L1956"></a><tt class="py-lineno">1956</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">order</tt><tt class="py-op">)</tt> </tt>
<a name="L1957"></a><tt class="py-lineno">1957</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">uv</tt><tt class="py-op">)</tt> </tt>
<a name="L1958"></a><tt class="py-lineno">1958</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1959"></a><tt class="py-lineno">1959</tt>  <tt class="py-line">            <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">ab</tt><tt class="py-op">)</tt> </tt>
<a name="L1960"></a><tt class="py-lineno">1960</tt>  <tt class="py-line">        <tt class="py-name">ca</tt><tt class="py-op">=</tt><tt class="py-number">0.</tt> </tt>
<a name="L1961"></a><tt class="py-lineno">1961</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">gg</tt> <tt class="py-keyword">in</tt> <tt class="py-name">rgu</tt><tt class="py-op">:</tt> </tt>
<a name="L1962"></a><tt class="py-lineno">1962</tt>  <tt class="py-line">            <tt class="py-comment">#range of v</tt> </tt>
<a name="L1963"></a><tt class="py-lineno">1963</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt><tt class="py-op">:</tt> </tt>
<a name="L1964"></a><tt class="py-lineno">1964</tt>  <tt class="py-line">                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"eq "</tt><tt class="py-op">,</tt><tt class="py-name">u</tt> <tt class="py-op">,</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">u</tt> <tt class="py-op">*</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice2</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">u</tt> <tt class="py-op">*</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1965"></a><tt class="py-lineno">1965</tt>  <tt class="py-line">            <tt class="py-comment">#y = ax+b</tt> </tt>
<a name="L1966"></a><tt class="py-lineno">1966</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">va</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">u</tt> <tt class="py-op">*</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1967"></a><tt class="py-lineno">1967</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice1</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">0.</tt> <tt class="py-keyword">and</tt> <tt class="py-name">u</tt> <tt class="py-op">==</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L1968"></a><tt class="py-lineno">1968</tt>  <tt class="py-line">                <tt class="py-name">vb</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-comment"># - distv[order[0]][order[1]]     </tt> </tt>
<a name="L1969"></a><tt class="py-lineno">1969</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1970"></a><tt class="py-lineno">1970</tt>  <tt class="py-line">                <tt class="py-name">vb</tt> <tt class="py-op">=</tt> <tt class="py-name">int</tt><tt class="py-op">(</tt><tt class="py-name">u</tt> <tt class="py-op">*</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">+</tt> <tt class="py-name">ab</tt><tt class="py-op">[</tt><tt class="py-name">indice2</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L1971"></a><tt class="py-lineno">1971</tt>  <tt class="py-line">            <tt class="py-comment">#if up :</tt> </tt>
<a name="L1972"></a><tt class="py-lineno">1972</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">rg</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">va</tt><tt class="py-op">,</tt><tt class="py-name">vb</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1973"></a><tt class="py-lineno">1973</tt>  <tt class="py-line">            <tt class="py-comment">#else :</tt> </tt>
<a name="L1974"></a><tt class="py-lineno">1974</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-comment">#    rg = range(vb,va+1)</tt> </tt>
<a name="L1975"></a><tt class="py-lineno">1975</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rg</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0</tt> <tt class="py-op">:</tt> </tt>
<a name="L1976"></a><tt class="py-lineno">1976</tt>  <tt class="py-line">                <tt class="py-name">rg</tt> <tt class="py-op">=</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">vb</tt><tt class="py-op">,</tt><tt class="py-name">va</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1977"></a><tt class="py-lineno">1977</tt>  <tt class="py-line">            <tt class="py-name">n</tt> <tt class="py-op">=</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rg</tt><tt class="py-op">)</tt>         </tt>
<a name="L1978"></a><tt class="py-lineno">1978</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt><tt class="py-op">:</tt> </tt>
<a name="L1979"></a><tt class="py-lineno">1979</tt>  <tt class="py-line">                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"range V "</tt><tt class="py-op">,</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">va</tt><tt class="py-op">,</tt><tt class="py-name">vb</tt><tt class="py-op">,</tt><tt class="py-name">rg</tt><tt class="py-op">)</tt> </tt>
<a name="L1980"></a><tt class="py-lineno">1980</tt>  <tt class="py-line">            <tt class="py-name">xcola</tt> <tt class="py-op">=</tt> <tt id="link-239" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-239', 'x', 'link-20');">x</a></tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgu</tt><tt class="py-op">)</tt> <tt class="py-comment">#* ab[2][0] + ab[2][1] #</tt> </tt>
<a name="L1981"></a><tt class="py-lineno">1981</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1982"></a><tt class="py-lineno">1982</tt>  <tt class="py-line">                <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"xcola"</tt><tt class="py-op">,</tt><tt class="py-name">xcola</tt><tt class="py-op">,</tt> <tt id="link-240" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-240', 'x', 'link-20');">x</a></tt><tt class="py-op">,</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgu</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">ca</tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgu</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L1983"></a><tt class="py-lineno">1983</tt>  <tt class="py-line">             </tt>
<a name="L1984"></a><tt class="py-lineno">1984</tt>  <tt class="py-line">            <tt id="link-241" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-241', 'y', 'link-21');">y</a></tt><tt class="py-op">=</tt><tt class="py-number">0.</tt> </tt>
<a name="L1985"></a><tt class="py-lineno">1985</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">cb</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">rg</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L1986"></a><tt class="py-lineno">1986</tt>  <tt class="py-line">                <tt class="py-name">k</tt> <tt class="py-op">=</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">maxv</tt><tt class="py-op">)</tt><tt class="py-op">-</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt> </tt>
<a name="L1987"></a><tt class="py-lineno">1987</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">k</tt> <tt class="py-op">&lt;</tt> <tt class="py-number">0</tt> <tt class="py-op">:</tt> </tt>
<a name="L1988"></a><tt class="py-lineno">1988</tt>  <tt class="py-line">                    <tt class="py-name">k</tt> <tt class="py-op">=</tt> <tt class="py-name">k</tt><tt class="py-op">*</tt><tt class="py-op">-</tt><tt class="py-number">1.</tt> </tt>
<a name="L1989"></a><tt class="py-lineno">1989</tt>  <tt class="py-line">                <tt class="py-name">ycola</tt> <tt class="py-op">=</tt> <tt class="py-name">k</tt><tt class="py-op">/</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-comment">#(x/len(rgu) * ab[indice1][0] + ab[indice1][1])/len(rgv) #</tt> </tt>
<a name="L1990"></a><tt class="py-lineno">1990</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L1991"></a><tt class="py-lineno">1991</tt>  <tt class="py-line">                    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"ycola"</tt><tt class="py-op">,</tt><tt id="link-242" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-242', 'y', 'link-21');">y</a></tt><tt class="py-op">,</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt id="link-243" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-243', 'y', 'link-21');">y</a></tt><tt class="py-op">/</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">rgv</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">ycola</tt><tt class="py-op">)</tt> </tt>
<a name="L1992"></a><tt class="py-lineno">1992</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0.</tt><tt class="py-op">:</tt>  </tt>
<a name="L1993"></a><tt class="py-lineno">1993</tt>  <tt class="py-line">                    <tt class="py-comment">#if up:</tt> </tt>
<a name="L1994"></a><tt class="py-lineno">1994</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-name">xcol</tt> <tt class="py-op">=</tt> <tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt> </tt>
<a name="L1995"></a><tt class="py-lineno">1995</tt>  <tt class="py-line">                    <tt class="py-comment">#else :</tt> </tt>
<a name="L1996"></a><tt class="py-lineno">1996</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-comment">#    xcol = color[order[2]]</tt> </tt>
<a name="L1997"></a><tt class="py-lineno">1997</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L1998"></a><tt class="py-lineno">1998</tt>  <tt class="py-line">                    <tt class="py-comment">#if up:</tt> </tt>
<a name="L1999"></a><tt class="py-lineno">1999</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-comment">#    xcol = color[order[2]]+x/len(rgu)*(color[order[0]]-color[order[2]])</tt> </tt>
<a name="L2000"></a><tt class="py-lineno">2000</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-comment">#else :</tt> </tt>
<a name="L2001"></a><tt class="py-lineno">2001</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-name">xcol</tt> <tt class="py-op">=</tt> <tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">+</tt><tt class="py-name">xcola</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L2002"></a><tt class="py-lineno">2002</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">.</tt><tt class="py-name">sum</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">0.</tt><tt class="py-op">:</tt> </tt>
<a name="L2003"></a><tt class="py-lineno">2003</tt>  <tt class="py-line">                    <tt class="py-name">ycol</tt> <tt class="py-op">=</tt> <tt class="py-name">xcol</tt> </tt>
<a name="L2004"></a><tt class="py-lineno">2004</tt>  <tt class="py-line">                <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L2005"></a><tt class="py-lineno">2005</tt>  <tt class="py-line">                    <tt class="py-comment">#if up :</tt> </tt>
<a name="L2006"></a><tt class="py-lineno">2006</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-name">ycol</tt> <tt class="py-op">=</tt> <tt class="py-name">xcol</tt><tt class="py-op">+</tt><tt class="py-op">(</tt><tt class="py-number">1</tt><tt class="py-op">-</tt><tt class="py-name">ycola</tt><tt class="py-op">)</tt><tt class="py-op">*</tt><tt class="py-op">(</tt><tt class="py-name">color</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">xcol</tt><tt class="py-op">)</tt> </tt>
<a name="L2007"></a><tt class="py-lineno">2007</tt>  <tt class="py-line">                    <tt class="py-comment">#else :</tt> </tt>
<a name="L2008"></a><tt class="py-lineno">2008</tt>  <tt class="py-line"><tt class="py-comment"></tt>                    <tt class="py-comment">#ycol = color[order[1]]+y/n*(xcol-color[order[1]])</tt> </tt>
<a name="L2009"></a><tt class="py-lineno">2009</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L2010"></a><tt class="py-lineno">2010</tt>  <tt class="py-line">                    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">xcol</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">)</tt> </tt>
<a name="L2011"></a><tt class="py-lineno">2011</tt>  <tt class="py-line">                <tt class="py-name">imdraw</tt><tt class="py-op">.</tt><tt class="py-name">point</tt><tt class="py-op">(</tt><tt class="py-op">(</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">,</tt><tt class="py-name">fill</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ycol</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L2012"></a><tt class="py-lineno">2012</tt>  <tt class="py-line">                <tt id="link-244" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-244', 'y', 'link-21');">y</a></tt> <tt class="py-op">=</tt> <tt id="link-245" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.y" class="py-name" href="#" onclick="return doclink('link-245', 'y', 'link-21');">y</a></tt> <tt class="py-op">+</tt> <tt class="py-number">1.</tt> </tt>
<a name="L2013"></a><tt class="py-lineno">2013</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">u</tt> <tt class="py-op">==</tt> <tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L2014"></a><tt class="py-lineno">2014</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">debug</tt> <tt class="py-op">:</tt> </tt>
<a name="L2015"></a><tt class="py-lineno">2015</tt>  <tt class="py-line">                    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-string">"end"</tt><tt class="py-op">,</tt><tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">uv</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L2016"></a><tt class="py-lineno">2016</tt>  <tt class="py-line">    <tt class="py-comment">#            if y == uv[order[1]][1] :</tt> </tt>
<a name="L2017"></a><tt class="py-lineno">2017</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#                print "change line eq",y , uv[order[1]][1],indice1,indice2</tt> </tt>
<a name="L2018"></a><tt class="py-lineno">2018</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">indice1</tt> <tt class="py-op">=</tt> <tt class="py-number">1</tt> </tt>
<a name="L2019"></a><tt class="py-lineno">2019</tt>  <tt class="py-line">    <tt class="py-comment">#                if order[0] == orderv[0] :</tt> </tt>
<a name="L2020"></a><tt class="py-lineno">2020</tt>  <tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-comment">#                    indice1 = orderv[0]</tt> </tt>
<a name="L2021"></a><tt class="py-lineno">2021</tt>  <tt class="py-line"><tt class="py-comment"></tt>                <tt class="py-name">indice2</tt> <tt class="py-op">=</tt> <tt class="py-number">2</tt> </tt>
<a name="L2022"></a><tt class="py-lineno">2022</tt>  <tt class="py-line">     </tt>
<a name="L2023"></a><tt class="py-lineno">2023</tt>  <tt class="py-line">    <tt class="py-comment">#                print indice1,indice2</tt> </tt>
<a name="L2024"></a><tt class="py-lineno">2024</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">u</tt> <tt class="py-op">=</tt> <tt class="py-name">u</tt> <tt class="py-op">+</tt> <tt class="py-number">1</tt>   </tt>
<a name="L2025"></a><tt class="py-lineno">2025</tt>  <tt class="py-line">            <tt id="link-246" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-246', 'x', 'link-20');">x</a></tt> <tt class="py-op">=</tt><tt id="link-247" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-247', 'x', 'link-20');">x</a></tt> <tt class="py-op">+</tt><tt class="py-number">1.</tt> </tt>
</div><a name="L2026"></a><tt class="py-lineno">2026</tt>  <tt class="py-line">             </tt>
<a name="Helper.getOrder"></a><div id="Helper.getOrder-def"><a name="L2027"></a><tt class="py-lineno">2027</tt> <a class="py-toggle" href="#" id="Helper.getOrder-toggle" onclick="return toggle('Helper.getOrder');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getOrder">getOrder</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">distu</tt><tt class="py-op">,</tt><tt class="py-param">uv</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getOrder-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getOrder-expanded"><a name="L2028"></a><tt class="py-lineno">2028</tt>  <tt class="py-line">        <tt class="py-name">order</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> </tt>
<a name="L2029"></a><tt class="py-lineno">2029</tt>  <tt class="py-line">        <tt class="py-name">u</tt><tt class="py-op">,</tt><tt class="py-name">v</tt> <tt class="py-op">=</tt> <tt class="py-name">uv</tt><tt class="py-op">.</tt><tt class="py-name">transpose</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2030"></a><tt class="py-lineno">2030</tt>  <tt class="py-line">        <tt class="py-name">imaxu</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">nonzero</tt><tt class="py-op">(</tt><tt class="py-name">u</tt> <tt class="py-op">==</tt> <tt class="py-name">u</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-comment">#[0]</tt> </tt>
<a name="L2031"></a><tt class="py-lineno">2031</tt>  <tt class="py-line">        <tt class="py-name">imaxv</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">nonzero</tt><tt class="py-op">(</tt><tt class="py-name">v</tt> <tt class="py-op">==</tt> <tt class="py-name">v</tt><tt class="py-op">.</tt><tt class="py-name">max</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-comment">#[0]</tt> </tt>
<a name="L2032"></a><tt class="py-lineno">2032</tt>  <tt class="py-line">        <tt class="py-name">iminu</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">nonzero</tt><tt class="py-op">(</tt><tt class="py-name">u</tt> <tt class="py-op">==</tt> <tt class="py-name">u</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-comment">#[0]</tt> </tt>
<a name="L2033"></a><tt class="py-lineno">2033</tt>  <tt class="py-line">        <tt class="py-name">iminv</tt> <tt class="py-op">=</tt> <tt class="py-name">numpy</tt><tt class="py-op">.</tt><tt class="py-name">nonzero</tt><tt class="py-op">(</tt><tt class="py-name">v</tt> <tt class="py-op">==</tt> <tt class="py-name">v</tt><tt class="py-op">.</tt><tt class="py-name">min</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-comment">#[0]</tt> </tt>
<a name="L2034"></a><tt class="py-lineno">2034</tt>  <tt class="py-line">        <tt class="py-comment">#order0 should be left/top</tt> </tt>
<a name="L2035"></a><tt class="py-lineno">2035</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">iminu</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-op">:</tt> <tt class="py-comment">#</tt> </tt>
<a name="L2036"></a><tt class="py-lineno">2036</tt>  <tt class="py-line">            <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">iminu</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2037"></a><tt class="py-lineno">2037</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L2038"></a><tt class="py-lineno">2038</tt>  <tt class="py-line">            <tt class="py-comment">#different max,top one is the one with v mini</tt> </tt>
<a name="L2039"></a><tt class="py-lineno">2039</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">9999</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2040"></a><tt class="py-lineno">2040</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">ind</tt> <tt class="py-keyword">in</tt> <tt class="py-name">iminu</tt><tt class="py-op">:</tt> </tt>
<a name="L2041"></a><tt class="py-lineno">2041</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L2042"></a><tt class="py-lineno">2042</tt>  <tt class="py-line">                    <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt> </tt>
<a name="L2043"></a><tt class="py-lineno">2043</tt>  <tt class="py-line">            <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L2044"></a><tt class="py-lineno">2044</tt>  <tt class="py-line">        <tt class="py-comment">#order1</tt> </tt>
<a name="L2045"></a><tt class="py-lineno">2045</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#closest u from order[0]</tt> </tt>
<a name="L2046"></a><tt class="py-lineno">2046</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#print distu[order[0]]</tt> </tt>
<a name="L2047"></a><tt class="py-lineno">2047</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">min</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-number">9999</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2048"></a><tt class="py-lineno">2048</tt>  <tt class="py-line">        <tt class="py-name">ds</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L2049"></a><tt class="py-lineno">2049</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">i</tt><tt class="py-op">,</tt><tt class="py-name">d</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">distu</tt><tt class="py-op">[</tt><tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L2050"></a><tt class="py-lineno">2050</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">i</tt> <tt class="py-op">!=</tt> <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L2051"></a><tt class="py-lineno">2051</tt>  <tt class="py-line">                <tt class="py-name">ds</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">d</tt><tt class="py-op">)</tt> </tt>
<a name="L2052"></a><tt class="py-lineno">2052</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-op">-</tt><tt class="py-name">d</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt>   </tt>
<a name="L2053"></a><tt class="py-lineno">2053</tt>  <tt class="py-line">                    <tt class="py-name">min</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-name">d</tt><tt class="py-op">,</tt><tt class="py-name">i</tt><tt class="py-op">]</tt> </tt>
<a name="L2054"></a><tt class="py-lineno">2054</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">ds</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-name">ds</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L2055"></a><tt class="py-lineno">2055</tt>  <tt class="py-line">            <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">9999</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2056"></a><tt class="py-lineno">2056</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">ind</tt><tt class="py-op">,</tt><tt class="py-name">val</tt> <tt class="py-keyword">in</tt> <tt class="py-name">enumerate</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L2057"></a><tt class="py-lineno">2057</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">ind</tt> <tt class="py-op">!=</tt> <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L2058"></a><tt class="py-lineno">2058</tt>  <tt class="py-line">                    <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">ind</tt><tt class="py-op">,</tt><tt class="py-name">val</tt><tt class="py-op">)</tt> </tt>
<a name="L2059"></a><tt class="py-lineno">2059</tt>  <tt class="py-line">                    <tt class="py-keyword">if</tt> <tt class="py-name">val</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">:</tt> </tt>
<a name="L2060"></a><tt class="py-lineno">2060</tt>  <tt class="py-line">                        <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-name">val</tt><tt class="py-op">,</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt> </tt>
<a name="L2061"></a><tt class="py-lineno">2061</tt>  <tt class="py-line">        <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L2062"></a><tt class="py-lineno">2062</tt>  <tt class="py-line">        <tt class="py-comment">#order2</tt> </tt>
<a name="L2063"></a><tt class="py-lineno">2063</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">imaxu</tt><tt class="py-op">)</tt> <tt class="py-op">==</tt> <tt class="py-number">1</tt> <tt class="py-op">:</tt> </tt>
<a name="L2064"></a><tt class="py-lineno">2064</tt>  <tt class="py-line">            <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">imaxu</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2065"></a><tt class="py-lineno">2065</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L2066"></a><tt class="py-lineno">2066</tt>  <tt class="py-line">            <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-number">9999</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2067"></a><tt class="py-lineno">2067</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">ind</tt> <tt class="py-keyword">in</tt> <tt class="py-name">imaxu</tt><tt class="py-op">:</tt> </tt>
<a name="L2068"></a><tt class="py-lineno">2068</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-keyword">and</tt> <tt class="py-name">ind</tt> <tt class="py-op">!=</tt>  <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">:</tt> </tt>
<a name="L2069"></a><tt class="py-lineno">2069</tt>  <tt class="py-line">                    <tt class="py-name">min</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-name">v</tt><tt class="py-op">[</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">ind</tt><tt class="py-op">]</tt> </tt>
<a name="L2070"></a><tt class="py-lineno">2070</tt>  <tt class="py-line">            <tt class="py-name">order</tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt> <tt class="py-op">=</tt> <tt class="py-name">min</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt> </tt>
<a name="L2071"></a><tt class="py-lineno">2071</tt>  <tt class="py-line">        <tt class="py-comment">#print order</tt> </tt>
<a name="L2072"></a><tt class="py-lineno">2072</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">order</tt> </tt>
</div><a name="L2073"></a><tt class="py-lineno">2073</tt>  <tt class="py-line"> </tt>
<a name="Helper.getA"></a><div id="Helper.getA-def"><a name="L2074"></a><tt class="py-lineno">2074</tt> <a class="py-toggle" href="#" id="Helper.getA-toggle" onclick="return toggle('Helper.getA');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getA">getA</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">pt1</tt><tt class="py-op">,</tt><tt class="py-param">pt2</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getA-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getA-expanded"><a name="L2075"></a><tt class="py-lineno">2075</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">pt2</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">pt1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> <tt class="py-op">==</tt> <tt class="py-number">0.</tt> <tt class="py-op">:</tt> </tt>
<a name="L2076"></a><tt class="py-lineno">2076</tt>  <tt class="py-line">            <tt class="py-name">a</tt><tt class="py-op">=</tt><tt class="py-number">0.</tt> </tt>
<a name="L2077"></a><tt class="py-lineno">2077</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt> <tt class="py-op">:</tt> </tt>
<a name="L2078"></a><tt class="py-lineno">2078</tt>  <tt class="py-line">            <tt class="py-name">a</tt><tt class="py-op">=</tt><tt class="py-op">(</tt><tt class="py-name">pt2</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">pt1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">/</tt><tt class="py-op">(</tt><tt class="py-name">pt2</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">pt1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt> </tt>
<a name="L2079"></a><tt class="py-lineno">2079</tt>  <tt class="py-line">        <tt class="py-comment">#solve y = ax+b</tt> </tt>
<a name="L2080"></a><tt class="py-lineno">2080</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-comment">#b = y - ax</tt> </tt>
<a name="L2081"></a><tt class="py-lineno">2081</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">b</tt><tt class="py-op">=</tt><tt class="py-name">pt1</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">-</tt><tt class="py-name">a</tt><tt class="py-op">*</tt><tt class="py-name">pt1</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2082"></a><tt class="py-lineno">2082</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-op">(</tt><tt class="py-name">a</tt><tt class="py-op">,</tt><tt class="py-name">b</tt><tt class="py-op">)</tt> </tt>
</div><a name="L2083"></a><tt class="py-lineno">2083</tt>  <tt class="py-line"> </tt>
<a name="L2084"></a><tt class="py-lineno">2084</tt>  <tt class="py-line">     </tt>
<a name="L2085"></a><tt class="py-lineno">2085</tt>  <tt class="py-line">     </tt>
<a name="L2086"></a><tt class="py-lineno">2086</tt>  <tt class="py-line">    <tt class="py-comment">#DejaVu.indexedPolygon have also this function</tt> </tt>
<a name="L2087"></a><tt class="py-lineno">2087</tt>  <tt class="py-line"><tt class="py-comment"></tt>     </tt>
<a name="L2088"></a><tt class="py-lineno">2088</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2089"></a><tt class="py-lineno">2089</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#     mesh</tt> </tt>
<a name="L2090"></a><tt class="py-lineno">2090</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2091"></a><tt class="py-lineno">2091</tt>  <tt class="py-line"><tt class="py-comment"></tt>     </tt>
<a name="Helper.writeMeshToFile"></a><div id="Helper.writeMeshToFile-def"><a name="L2092"></a><tt class="py-lineno">2092</tt> <a class="py-toggle" href="#" id="Helper.writeMeshToFile-toggle" onclick="return toggle('Helper.writeMeshToFile');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#writeMeshToFile">writeMeshToFile</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">,</tt><tt class="py-param">verts</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">faces</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">vnorms</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-param">fnorms</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.writeMeshToFile-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.writeMeshToFile-expanded"><a name="L2093"></a><tt class="py-lineno">2093</tt>  <tt class="py-line">        <tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">+</tt><tt class="py-string">'.indpolvert'</tt><tt class="py-op">,</tt> <tt class="py-string">'w'</tt><tt class="py-op">)</tt> </tt>
<a name="L2094"></a><tt class="py-lineno">2094</tt>  <tt class="py-line">        <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%f %f %f %f %f %f\n"</tt><tt class="py-op">%</tt><tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">+</tt><tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">n</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L2095"></a><tt class="py-lineno">2095</tt>  <tt class="py-line">             <tt class="py-keyword">for</tt> <tt class="py-name">v</tt><tt class="py-op">,</tt><tt class="py-name">n</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">verts</tt><tt class="py-op">,</tt> <tt class="py-name">vnorms</tt><tt class="py-op">)</tt> <tt class="py-op">]</tt>  </tt>
<a name="L2096"></a><tt class="py-lineno">2096</tt>  <tt class="py-line"><tt class="py-comment">##        map( lambda v, n, f=file: \</tt> </tt>
<a name="L2097"></a><tt class="py-lineno">2097</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##                 f.write("%f %f %f %f %f %f\n"%tuple(tuple(v)+tuple(n))),</tt> </tt>
<a name="L2098"></a><tt class="py-lineno">2098</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">##             verts, vnorms)</tt> </tt>
<a name="L2099"></a><tt class="py-lineno">2099</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-248" class="py-name" targets="Method upy.uiAdaptor.uiAdaptor.close()=upy.uiAdaptor.uiAdaptor-class.html#close"><a title="upy.uiAdaptor.uiAdaptor.close" class="py-name" href="#" onclick="return doclink('link-248', 'close', 'link-248');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2100"></a><tt class="py-lineno">2100</tt>  <tt class="py-line"> </tt>
<a name="L2101"></a><tt class="py-lineno">2101</tt>  <tt class="py-line">        <tt class="py-name">file</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">+</tt><tt class="py-string">'.indpolface'</tt><tt class="py-op">,</tt> <tt class="py-string">'w'</tt><tt class="py-op">)</tt> </tt>
<a name="L2102"></a><tt class="py-lineno">2102</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">v</tt><tt class="py-op">,</tt> <tt class="py-name">face</tt> <tt class="py-keyword">in</tt> <tt class="py-name">zip</tt><tt class="py-op">(</tt><tt class="py-name">fnorms</tt><tt class="py-op">,</tt> <tt class="py-name">faces</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L2103"></a><tt class="py-lineno">2103</tt>  <tt class="py-line">            <tt class="py-op">[</tt><tt class="py-name">face</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%d "</tt><tt class="py-op">%</tt><tt class="py-name">ind</tt> <tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">ind</tt> <tt class="py-keyword">in</tt> <tt class="py-name">face</tt><tt class="py-op">]</tt> </tt>
<a name="L2104"></a><tt class="py-lineno">2104</tt>  <tt class="py-line">            <tt class="py-comment">#map( lambda ind, f=file: f.write("%d "%ind ), face )</tt> </tt>
<a name="L2105"></a><tt class="py-lineno">2105</tt>  <tt class="py-line"><tt class="py-comment"></tt>            <tt class="py-name">file</tt><tt class="py-op">.</tt><tt class="py-name">write</tt><tt class="py-op">(</tt><tt class="py-string">"%f %f %f\n"</tt><tt class="py-op">%</tt><tt class="py-name">tuple</tt><tt class="py-op">(</tt><tt class="py-name">v</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L2106"></a><tt class="py-lineno">2106</tt>  <tt class="py-line">        <tt class="py-name">file</tt><tt class="py-op">.</tt><tt id="link-249" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.close" class="py-name" href="#" onclick="return doclink('link-249', 'close', 'link-248');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt>         </tt>
</div><a name="L2107"></a><tt class="py-lineno">2107</tt>  <tt class="py-line">     </tt>
<a name="Helper.readMeshFromFile"></a><div id="Helper.readMeshFromFile-def"><a name="L2108"></a><tt class="py-lineno">2108</tt> <a class="py-toggle" href="#" id="Helper.readMeshFromFile-toggle" onclick="return toggle('Helper.readMeshFromFile');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#readMeshFromFile">readMeshFromFile</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.readMeshFromFile-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.readMeshFromFile-expanded"><a name="L2109"></a><tt class="py-lineno">2109</tt>  <tt class="py-line">        <tt class="py-name">filename</tt> <tt class="py-op">=</tt> <tt class="py-name">os</tt><tt class="py-op">.</tt><tt class="py-name">path</tt><tt class="py-op">.</tt><tt class="py-name">splitext</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">)</tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt> </tt>
<a name="L2110"></a><tt class="py-lineno">2110</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">+</tt><tt class="py-string">'.indpolvert'</tt><tt class="py-op">)</tt> </tt>
<a name="L2111"></a><tt class="py-lineno">2111</tt>  <tt class="py-line">        <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">readlines</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2112"></a><tt class="py-lineno">2112</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">l</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">l</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">]</tt> </tt>
<a name="L2113"></a><tt class="py-lineno">2113</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt id="link-250" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.close" class="py-name" href="#" onclick="return doclink('link-250', 'close', 'link-248');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2114"></a><tt class="py-lineno">2114</tt>  <tt class="py-line">         </tt>
<a name="L2115"></a><tt class="py-lineno">2115</tt>  <tt class="py-line">        <tt class="py-name">verts</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-251" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-251', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-252" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-252', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-253" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-253', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">2</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt id="link-254" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-254', 'x', 'link-20');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">data</tt><tt class="py-op">]</tt> </tt>
<a name="L2116"></a><tt class="py-lineno">2116</tt>  <tt class="py-line">        <tt class="py-name">norms</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">(</tt><tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-255" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-255', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-256" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-256', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">4</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> <tt class="py-name">float</tt><tt class="py-op">(</tt><tt id="link-257" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-257', 'x', 'link-20');">x</a></tt><tt class="py-op">[</tt><tt class="py-number">5</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt id="link-258" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.x" class="py-name" href="#" onclick="return doclink('link-258', 'x', 'link-20');">x</a></tt> <tt class="py-keyword">in</tt> <tt class="py-name">data</tt><tt class="py-op">]</tt> </tt>
<a name="L2117"></a><tt class="py-lineno">2117</tt>  <tt class="py-line">         </tt>
<a name="L2118"></a><tt class="py-lineno">2118</tt>  <tt class="py-line">        <tt class="py-name">f</tt> <tt class="py-op">=</tt> <tt class="py-name">open</tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">+</tt><tt class="py-string">'.indpolface'</tt><tt class="py-op">)</tt> </tt>
<a name="L2119"></a><tt class="py-lineno">2119</tt>  <tt class="py-line">        <tt class="py-name">lines</tt> <tt class="py-op">=</tt> <tt class="py-name">f</tt><tt class="py-op">.</tt><tt class="py-name">readlines</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2120"></a><tt class="py-lineno">2120</tt>  <tt class="py-line">        <tt class="py-name">data</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-name">l</tt><tt class="py-op">.</tt><tt class="py-name">split</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> <tt class="py-keyword">for</tt> <tt class="py-name">l</tt> <tt class="py-keyword">in</tt> <tt class="py-name">lines</tt><tt class="py-op">]</tt> </tt>
<a name="L2121"></a><tt class="py-lineno">2121</tt>  <tt class="py-line">        <tt class="py-name">f</tt><tt class="py-op">.</tt><tt id="link-259" class="py-name"><a title="upy.uiAdaptor.uiAdaptor.close" class="py-name" href="#" onclick="return doclink('link-259', 'close', 'link-248');">close</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L2122"></a><tt class="py-lineno">2122</tt>  <tt class="py-line"> </tt>
<a name="L2123"></a><tt class="py-lineno">2123</tt>  <tt class="py-line">        <tt class="py-name">faces</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L2124"></a><tt class="py-lineno">2124</tt>  <tt class="py-line">        <tt class="py-name">fnorms</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L2125"></a><tt class="py-lineno">2125</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">line</tt> <tt class="py-keyword">in</tt> <tt class="py-name">data</tt><tt class="py-op">:</tt> </tt>
<a name="L2126"></a><tt class="py-lineno">2126</tt>  <tt class="py-line">            <tt class="py-name">faces</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt> <tt class="py-name">int</tt><tt class="py-op">,</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-op">:</tt><tt class="py-op">-</tt><tt class="py-number">3</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L2127"></a><tt class="py-lineno">2127</tt>  <tt class="py-line">            <tt class="py-name">fnorms</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt> <tt class="py-name">list</tt><tt class="py-op">(</tt><tt class="py-name">map</tt><tt class="py-op">(</tt> <tt class="py-name">float</tt><tt class="py-op">,</tt> <tt class="py-name">line</tt><tt class="py-op">[</tt><tt class="py-op">-</tt><tt class="py-number">3</tt><tt class="py-op">:</tt><tt class="py-op">]</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> <tt class="py-op">)</tt> </tt>
<a name="L2128"></a><tt class="py-lineno">2128</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">verts</tt><tt class="py-op">,</tt><tt class="py-name">faces</tt><tt class="py-op">,</tt><tt class="py-name">norms</tt> </tt>
</div><a name="L2129"></a><tt class="py-lineno">2129</tt>  <tt class="py-line"> </tt>
<a name="Helper.writeToFile"></a><div id="Helper.writeToFile-def"><a name="L2130"></a><tt class="py-lineno">2130</tt> <a class="py-toggle" href="#" id="Helper.writeToFile-toggle" onclick="return toggle('Helper.writeToFile');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#writeToFile">writeToFile</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">polygon</tt><tt class="py-op">,</tt><tt class="py-param">filename</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.writeToFile-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.writeToFile-expanded"><a name="L2131"></a><tt class="py-lineno">2131</tt>  <tt class="py-line">        <tt class="py-docstring">"""swriteToFile(filename)</tt> </tt>
<a name="L2132"></a><tt class="py-lineno">2132</tt>  <tt class="py-line"><tt class="py-docstring">        Creates a .vert and a face file describing this indexed polygons geoemtry.</tt> </tt>
<a name="L2133"></a><tt class="py-lineno">2133</tt>  <tt class="py-line"><tt class="py-docstring">        only vertices, and noramsl are saved the the .vert file (x y z nx ny nz)</tt> </tt>
<a name="L2134"></a><tt class="py-lineno">2134</tt>  <tt class="py-line"><tt class="py-docstring">        and 0-based topoly in the .face file (i, j, k, ... ).</tt> </tt>
<a name="L2135"></a><tt class="py-lineno">2135</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2136"></a><tt class="py-lineno">2136</tt>  <tt class="py-line">        <tt class="py-keyword">print</tt><tt class="py-op">(</tt><tt class="py-name">polygon</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-260" class="py-name" targets="Method upy.hostHelper.Helper.getName()=upy.hostHelper.Helper-class.html#getName"><a title="upy.hostHelper.Helper.getName" class="py-name" href="#" onclick="return doclink('link-260', 'getName', 'link-260');">getName</a></tt><tt class="py-op">(</tt><tt class="py-name">polygon</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L2137"></a><tt class="py-lineno">2137</tt>  <tt class="py-line">        <tt class="py-name">faces</tt><tt class="py-op">,</tt><tt class="py-name">vertices</tt><tt class="py-op">,</tt><tt class="py-name">vnormals</tt><tt class="py-op">,</tt><tt class="py-name">fnormals</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">DecomposeMesh</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-261" class="py-name" targets="Method upy.hostHelper.Helper.getMesh()=upy.hostHelper.Helper-class.html#getMesh"><a title="upy.hostHelper.Helper.getMesh" class="py-name" href="#" onclick="return doclink('link-261', 'getMesh', 'link-261');">getMesh</a></tt><tt class="py-op">(</tt><tt class="py-name">polygon</tt><tt class="py-op">)</tt><tt class="py-op">,</tt> </tt>
<a name="L2138"></a><tt class="py-lineno">2138</tt>  <tt class="py-line">                                                <tt class="py-name">edit</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">copy</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-name">tri</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">transform</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">,</tt><tt class="py-name">fn</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt> </tt>
<a name="L2139"></a><tt class="py-lineno">2139</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-262" class="py-name" targets="Method upy.hostHelper.Helper.writeMeshToFile()=upy.hostHelper.Helper-class.html#writeMeshToFile"><a title="upy.hostHelper.Helper.writeMeshToFile" class="py-name" href="#" onclick="return doclink('link-262', 'writeMeshToFile', 'link-262');">writeMeshToFile</a></tt><tt class="py-op">(</tt><tt class="py-name">filename</tt><tt class="py-op">,</tt><tt class="py-name">verts</tt><tt class="py-op">=</tt><tt class="py-name">vertices</tt><tt class="py-op">,</tt><tt class="py-name">faces</tt><tt class="py-op">=</tt><tt class="py-name">faces</tt><tt class="py-op">,</tt> </tt>
<a name="L2140"></a><tt class="py-lineno">2140</tt>  <tt class="py-line">                             <tt class="py-name">vnorms</tt><tt class="py-op">=</tt><tt class="py-name">vnormals</tt><tt class="py-op">,</tt><tt class="py-name">fnorms</tt><tt class="py-op">=</tt><tt class="py-name">fnormals</tt><tt class="py-op">)</tt> </tt>
</div><a name="L2141"></a><tt class="py-lineno">2141</tt>  <tt class="py-line"> </tt>
<a name="Helper.findClosestPoint"></a><div id="Helper.findClosestPoint-def"><a name="L2142"></a><tt class="py-lineno">2142</tt> <a class="py-toggle" href="#" id="Helper.findClosestPoint-toggle" onclick="return toggle('Helper.findClosestPoint');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#findClosestPoint">findClosestPoint</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">point</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">transform</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.findClosestPoint-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.findClosestPoint-expanded"><a name="L2143"></a><tt class="py-lineno">2143</tt>  <tt class="py-line">        <tt class="py-comment">#python lookup for closest point,probably not the fastest way</tt> </tt>
<a name="L2144"></a><tt class="py-lineno">2144</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">vertices</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-263" class="py-name" targets="Method upy.hostHelper.Helper.getMeshVertices()=upy.hostHelper.Helper-class.html#getMeshVertices"><a title="upy.hostHelper.Helper.getMeshVertices" class="py-name" href="#" onclick="return doclink('link-263', 'getMeshVertices', 'link-263');">getMeshVertices</a></tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L2145"></a><tt class="py-lineno">2145</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">transform</tt> <tt class="py-op">:</tt> </tt>
<a name="L2146"></a><tt class="py-lineno">2146</tt>  <tt class="py-line">            <tt class="py-name">mat</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">getTransformation</tt><tt class="py-op">(</tt><tt class="py-name">object</tt><tt class="py-op">)</tt> </tt>
<a name="L2147"></a><tt class="py-lineno">2147</tt>  <tt class="py-line">            <tt class="py-name">vertices</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-264" class="py-name" targets="Method upy.hostHelper.Helper.ApplyMatrix()=upy.hostHelper.Helper-class.html#ApplyMatrix"><a title="upy.hostHelper.Helper.ApplyMatrix" class="py-name" href="#" onclick="return doclink('link-264', 'ApplyMatrix', 'link-264');">ApplyMatrix</a></tt><tt class="py-op">(</tt><tt class="py-name">vertices</tt><tt class="py-op">,</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-265" class="py-name" targets="Method upy.hostHelper.Helper.ToMat()=upy.hostHelper.Helper-class.html#ToMat"><a title="upy.hostHelper.Helper.ToMat" class="py-name" href="#" onclick="return doclink('link-265', 'ToMat', 'link-265');">ToMat</a></tt><tt class="py-op">(</tt><tt class="py-name">mat</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L2148"></a><tt class="py-lineno">2148</tt>  <tt class="py-line">        <tt class="py-comment">#bhtree?</tt> </tt>
<a name="L2149"></a><tt class="py-lineno">2149</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-name">mini</tt><tt class="py-op">=</tt><tt class="py-number">9999.0</tt> </tt>
<a name="L2150"></a><tt class="py-lineno">2150</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">v</tt> <tt class="py-keyword">in</tt> <tt class="py-name">range</tt><tt class="py-op">(</tt><tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">vertices</tt><tt class="py-op">)</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
<a name="L2151"></a><tt class="py-lineno">2151</tt>  <tt class="py-line">            <tt class="py-name">d</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-266" class="py-name"><a title="upy.hostHelper.Helper.measure_distance" class="py-name" href="#" onclick="return doclink('link-266', 'measure_distance', 'link-36');">measure_distance</a></tt><tt class="py-op">(</tt><tt class="py-name">vertices</tt><tt class="py-op">[</tt><tt class="py-name">v</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-name">point</tt><tt class="py-op">)</tt> </tt>
<a name="L2152"></a><tt class="py-lineno">2152</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">d</tt> <tt class="py-op">&lt;</tt> <tt class="py-name">mini</tt> <tt class="py-op">:</tt>  </tt>
<a name="L2153"></a><tt class="py-lineno">2153</tt>  <tt class="py-line">                <tt class="py-name">mini</tt> <tt class="py-op">=</tt><tt class="py-name">d</tt> </tt>
<a name="L2154"></a><tt class="py-lineno">2154</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">mini</tt> </tt>
</div><a name="L2155"></a><tt class="py-lineno">2155</tt>  <tt class="py-line"> </tt>
<a name="Helper.ToMat"></a><div id="Helper.ToMat-def"><a name="L2156"></a><tt class="py-lineno">2156</tt> <a class="py-toggle" href="#" id="Helper.ToMat-toggle" onclick="return toggle('Helper.ToMat');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#ToMat">ToMat</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">mat</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.ToMat-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.ToMat-expanded"><a name="L2157"></a><tt class="py-lineno">2157</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2158"></a><tt class="py-lineno">2158</tt>  <tt class="py-line"><tt class="py-docstring">        Return a python (4,4) matrice array from a host matrice</tt> </tt>
<a name="L2159"></a><tt class="py-lineno">2159</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L2160"></a><tt class="py-lineno">2160</tt>  <tt class="py-line"><tt class="py-docstring">        @type  v: host matrice array</tt> </tt>
<a name="L2161"></a><tt class="py-lineno">2161</tt>  <tt class="py-line"><tt class="py-docstring">        @param v: host matrice array </tt> </tt>
<a name="L2162"></a><tt class="py-lineno">2162</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   matrice</tt> </tt>
<a name="L2163"></a><tt class="py-lineno">2163</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the converted  matrice array</tt> </tt>
<a name="L2164"></a><tt class="py-lineno">2164</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2165"></a><tt class="py-lineno">2165</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">mat</tt> </tt>
</div><a name="L2166"></a><tt class="py-lineno">2166</tt>  <tt class="py-line">     </tt>
<a name="Helper.ToVec"></a><div id="Helper.ToVec-def"><a name="L2167"></a><tt class="py-lineno">2167</tt> <a class="py-toggle" href="#" id="Helper.ToVec-toggle" onclick="return toggle('Helper.ToVec');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#ToVec">ToVec</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">v</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.ToVec-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.ToVec-expanded"><a name="L2168"></a><tt class="py-lineno">2168</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2169"></a><tt class="py-lineno">2169</tt>  <tt class="py-line"><tt class="py-docstring">        Return a python xyz array from a host xyz array/vector</tt> </tt>
<a name="L2170"></a><tt class="py-lineno">2170</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L2171"></a><tt class="py-lineno">2171</tt>  <tt class="py-line"><tt class="py-docstring">        @type  v: host vector array</tt> </tt>
<a name="L2172"></a><tt class="py-lineno">2172</tt>  <tt class="py-line"><tt class="py-docstring">        @param v: host vector array </tt> </tt>
<a name="L2173"></a><tt class="py-lineno">2173</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   array</tt> </tt>
<a name="L2174"></a><tt class="py-lineno">2174</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the converted  vector array</tt> </tt>
<a name="L2175"></a><tt class="py-lineno">2175</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2176"></a><tt class="py-lineno">2176</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">v</tt> </tt>
</div><a name="L2177"></a><tt class="py-lineno">2177</tt>  <tt class="py-line">         </tt>
<a name="L2178"></a><tt class="py-lineno">2178</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2179"></a><tt class="py-lineno">2179</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Advanced Objects</tt> </tt>
<a name="L2180"></a><tt class="py-lineno">2180</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="Helper.createsNmesh"></a><div id="Helper.createsNmesh-def"><a name="L2181"></a><tt class="py-lineno">2181</tt> <a class="py-toggle" href="#" id="Helper.createsNmesh-toggle" onclick="return toggle('Helper.createsNmesh');">-</a><tt class="py-line"><tt class="py-comment"></tt>    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#createsNmesh">createsNmesh</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">vertices</tt><tt class="py-op">,</tt><tt class="py-param">vnormals</tt><tt class="py-op">,</tt><tt class="py-param">faces</tt><tt class="py-op">,</tt><tt class="py-param">smooth</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt> </tt>
<a name="L2182"></a><tt class="py-lineno">2182</tt>  <tt class="py-line">                     <tt class="py-param">material</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">proxyCol</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">,</tt><tt class="py-param">color</tt><tt class="py-op">=</tt><tt class="py-op">[</tt><tt class="py-op">[</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">,</tt><tt class="py-number">0</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">]</tt><tt class="py-op">,</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.createsNmesh-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.createsNmesh-expanded"><a name="L2183"></a><tt class="py-lineno">2183</tt>  <tt class="py-line">        <tt class="py-docstring">"""function that generate a Polygon object from the given vertices, face and normal.</tt> </tt>
<a name="L2184"></a><tt class="py-lineno">2184</tt>  <tt class="py-line"><tt class="py-docstring">        material or color can be passed and apply to the created polygon.</tt> </tt>
<a name="L2185"></a><tt class="py-lineno">2185</tt>  <tt class="py-line"><tt class="py-docstring">        Return the object and the mesh</tt> </tt>
<a name="L2186"></a><tt class="py-lineno">2186</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2187"></a><tt class="py-lineno">2187</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2188"></a><tt class="py-lineno">2188</tt>  <tt class="py-line">     </tt>
<a name="Helper.PointCloudObject"></a><div id="Helper.PointCloudObject-def"><a name="L2189"></a><tt class="py-lineno">2189</tt> <a class="py-toggle" href="#" id="Helper.PointCloudObject-toggle" onclick="return toggle('Helper.PointCloudObject');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#PointCloudObject">PointCloudObject</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.PointCloudObject-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.PointCloudObject-expanded"><a name="L2190"></a><tt class="py-lineno">2190</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2191"></a><tt class="py-lineno">2191</tt>  <tt class="py-line"><tt class="py-docstring">        This function create a special polygon which have only point.</tt> </tt>
<a name="L2192"></a><tt class="py-lineno">2192</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L2193"></a><tt class="py-lineno">2193</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L2194"></a><tt class="py-lineno">2194</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the pointCloud</tt> </tt>
<a name="L2195"></a><tt class="py-lineno">2195</tt>  <tt class="py-line"><tt class="py-docstring">        @type  kw: dictionary</tt> </tt>
<a name="L2196"></a><tt class="py-lineno">2196</tt>  <tt class="py-line"><tt class="py-docstring">        @param kw: dictionary of arg options, ie :</tt> </tt>
<a name="L2197"></a><tt class="py-lineno">2197</tt>  <tt class="py-line"><tt class="py-docstring">            'vertices' array of coordinates ;</tt> </tt>
<a name="L2198"></a><tt class="py-lineno">2198</tt>  <tt class="py-line"><tt class="py-docstring">            'faces'    int array of faces ;</tt> </tt>
<a name="L2199"></a><tt class="py-lineno">2199</tt>  <tt class="py-line"><tt class="py-docstring">            'parent'   hostAp parent object</tt> </tt>
<a name="L2200"></a><tt class="py-lineno">2200</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L2201"></a><tt class="py-lineno">2201</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   hostApp obj</tt> </tt>
<a name="L2202"></a><tt class="py-lineno">2202</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the polygon object</tt> </tt>
<a name="L2203"></a><tt class="py-lineno">2203</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2204"></a><tt class="py-lineno">2204</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2205"></a><tt class="py-lineno">2205</tt>  <tt class="py-line">         </tt>
<a name="L2206"></a><tt class="py-lineno">2206</tt>  <tt class="py-line">         </tt>
<a name="L2207"></a><tt class="py-lineno">2207</tt>  <tt class="py-line">     </tt>
<a name="L2208"></a><tt class="py-lineno">2208</tt>  <tt class="py-line">     </tt>
<a name="Helper.addBone"></a><div id="Helper.addBone-def"><a name="L2209"></a><tt class="py-lineno">2209</tt> <a class="py-toggle" href="#" id="Helper.addBone-toggle" onclick="return toggle('Helper.addBone');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#addBone">addBone</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">i</tt><tt class="py-op">,</tt><tt class="py-param">armData</tt><tt class="py-op">,</tt><tt class="py-param">headCoord</tt><tt class="py-op">,</tt><tt class="py-param">tailCoord</tt><tt class="py-op">,</tt> </tt>
<a name="L2210"></a><tt class="py-lineno">2210</tt>  <tt class="py-line">                <tt class="py-param">roll</tt><tt class="py-op">=</tt><tt class="py-number">10</tt><tt class="py-op">,</tt><tt class="py-param">hR</tt><tt class="py-op">=</tt><tt class="py-number">0.5</tt><tt class="py-op">,</tt><tt class="py-param">tR</tt><tt class="py-op">=</tt><tt class="py-number">0.5</tt><tt class="py-op">,</tt><tt class="py-param">dDist</tt><tt class="py-op">=</tt><tt class="py-number">0.4</tt><tt class="py-op">,</tt><tt class="py-param">boneParent</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt> </tt>
<a name="L2211"></a><tt class="py-lineno">2211</tt>  <tt class="py-line">                <tt class="py-param">name</tt><tt class="py-op">=</tt><tt class="py-name">None</tt><tt class="py-op">,</tt><tt class="py-param">editMode</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.addBone-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.addBone-expanded"><a name="L2212"></a><tt class="py-lineno">2212</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2213"></a><tt class="py-lineno">2213</tt>  <tt class="py-line"><tt class="py-docstring">        Add one bone to an armature.</tt> </tt>
<a name="L2214"></a><tt class="py-lineno">2214</tt>  <tt class="py-line"><tt class="py-docstring">        Optional function for creation of the armature</tt> </tt>
<a name="L2215"></a><tt class="py-lineno">2215</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L2216"></a><tt class="py-lineno">2216</tt>  <tt class="py-line"><tt class="py-docstring">        @type  i: int</tt> </tt>
<a name="L2217"></a><tt class="py-lineno">2217</tt>  <tt class="py-line"><tt class="py-docstring">        @param i: indice for the new bone</tt> </tt>
<a name="L2218"></a><tt class="py-lineno">2218</tt>  <tt class="py-line"><tt class="py-docstring">        @type  armData: armature host data</tt> </tt>
<a name="L2219"></a><tt class="py-lineno">2219</tt>  <tt class="py-line"><tt class="py-docstring">        @param armData: the armature</tt> </tt>
<a name="L2220"></a><tt class="py-lineno">2220</tt>  <tt class="py-line"><tt class="py-docstring">        @type  headCoord: array xyz</tt> </tt>
<a name="L2221"></a><tt class="py-lineno">2221</tt>  <tt class="py-line"><tt class="py-docstring">        @param headCoord: coordinate of the head of the bone</tt> </tt>
<a name="L2222"></a><tt class="py-lineno">2222</tt>  <tt class="py-line"><tt class="py-docstring">        @type  tailCoord: array xyz</tt> </tt>
<a name="L2223"></a><tt class="py-lineno">2223</tt>  <tt class="py-line"><tt class="py-docstring">        @param tailCoord: coordinate of the tail of the bone</tt> </tt>
<a name="L2224"></a><tt class="py-lineno">2224</tt>  <tt class="py-line"><tt class="py-docstring">        @type  boneParent: bone</tt> </tt>
<a name="L2225"></a><tt class="py-lineno">2225</tt>  <tt class="py-line"><tt class="py-docstring">        @param boneParent: the parent for the created bone</tt> </tt>
<a name="L2226"></a><tt class="py-lineno">2226</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L2227"></a><tt class="py-lineno">2227</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   bone</tt> </tt>
<a name="L2228"></a><tt class="py-lineno">2228</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created bone</tt> </tt>
<a name="L2229"></a><tt class="py-lineno">2229</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L2230"></a><tt class="py-lineno">2230</tt>  <tt class="py-line">        <tt class="py-name">eb</tt><tt class="py-op">=</tt><tt class="py-name">None</tt> </tt>
<a name="L2231"></a><tt class="py-lineno">2231</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">eb</tt> </tt>
</div><a name="L2232"></a><tt class="py-lineno">2232</tt>  <tt class="py-line">         </tt>
<a name="Helper.armature"></a><div id="Helper.armature-def"><a name="L2233"></a><tt class="py-lineno">2233</tt> <a class="py-toggle" href="#" id="Helper.armature-toggle" onclick="return toggle('Helper.armature');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#armature">armature</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">coords</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.armature-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.armature-expanded"><a name="L2234"></a><tt class="py-lineno">2234</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2235"></a><tt class="py-lineno">2235</tt>  <tt class="py-line"><tt class="py-docstring">        Create an armature along the given coordinates</tt> </tt>
<a name="L2236"></a><tt class="py-lineno">2236</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L2237"></a><tt class="py-lineno">2237</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L2238"></a><tt class="py-lineno">2238</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the armature object</tt> </tt>
<a name="L2239"></a><tt class="py-lineno">2239</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coords: list of array xyz</tt> </tt>
<a name="L2240"></a><tt class="py-lineno">2240</tt>  <tt class="py-line"><tt class="py-docstring">        @param coords: coordinate foreach bone   </tt> </tt>
<a name="L2241"></a><tt class="py-lineno">2241</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   host Object</tt> </tt>
<a name="L2242"></a><tt class="py-lineno">2242</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created armature</tt> </tt>
<a name="L2243"></a><tt class="py-lineno">2243</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list of bone</tt> </tt>
<a name="L2244"></a><tt class="py-lineno">2244</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created bones        </tt> </tt>
<a name="L2245"></a><tt class="py-lineno">2245</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>                 </tt>
<a name="L2246"></a><tt class="py-lineno">2246</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2247"></a><tt class="py-lineno">2247</tt>  <tt class="py-line">        <tt class="py-comment">#return armObj,bones</tt> </tt>
<a name="L2248"></a><tt class="py-lineno">2248</tt>  <tt class="py-line"><tt class="py-comment"></tt>     </tt>
<a name="Helper.oneMetaBall"></a><div id="Helper.oneMetaBall-def"><a name="L2249"></a><tt class="py-lineno">2249</tt> <a class="py-toggle" href="#" id="Helper.oneMetaBall-toggle" onclick="return toggle('Helper.oneMetaBall');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#oneMetaBall">oneMetaBall</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">metab</tt><tt class="py-op">,</tt><tt class="py-param">rad</tt><tt class="py-op">,</tt><tt class="py-param">coord</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.oneMetaBall-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.oneMetaBall-expanded"><a name="L2250"></a><tt class="py-lineno">2250</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2251"></a><tt class="py-lineno">2251</tt>  <tt class="py-line"><tt class="py-docstring">        Add one ball to a metaball object.</tt> </tt>
<a name="L2252"></a><tt class="py-lineno">2252</tt>  <tt class="py-line"><tt class="py-docstring">        Optional function for creation of the metaball</tt> </tt>
<a name="L2253"></a><tt class="py-lineno">2253</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L2254"></a><tt class="py-lineno">2254</tt>  <tt class="py-line"><tt class="py-docstring">        @type  metab: metaball host data</tt> </tt>
<a name="L2255"></a><tt class="py-lineno">2255</tt>  <tt class="py-line"><tt class="py-docstring">        @param metab: the metaball</tt> </tt>
<a name="L2256"></a><tt class="py-lineno">2256</tt>  <tt class="py-line"><tt class="py-docstring">        @type  rad: float</tt> </tt>
<a name="L2257"></a><tt class="py-lineno">2257</tt>  <tt class="py-line"><tt class="py-docstring">        @param rad: radius for the new ball</tt> </tt>
<a name="L2258"></a><tt class="py-lineno">2258</tt>  <tt class="py-line"><tt class="py-docstring">        @type  coord: array xyz</tt> </tt>
<a name="L2259"></a><tt class="py-lineno">2259</tt>  <tt class="py-line"><tt class="py-docstring">        @param coord: coordinate of the ball</tt> </tt>
<a name="L2260"></a><tt class="py-lineno">2260</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L2261"></a><tt class="py-lineno">2261</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   ball/None</tt> </tt>
<a name="L2262"></a><tt class="py-lineno">2262</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the ball or None</tt> </tt>
<a name="L2263"></a><tt class="py-lineno">2263</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>         </tt>
<a name="L2264"></a><tt class="py-lineno">2264</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2265"></a><tt class="py-lineno">2265</tt>  <tt class="py-line">         </tt>
<a name="Helper.metaballs"></a><div id="Helper.metaballs-def"><a name="L2266"></a><tt class="py-lineno">2266</tt> <a class="py-toggle" href="#" id="Helper.metaballs-toggle" onclick="return toggle('Helper.metaballs');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#metaballs">metaballs</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">name</tt><tt class="py-op">,</tt><tt class="py-param">listePt</tt><tt class="py-op">,</tt><tt class="py-param">listeR</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.metaballs-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.metaballs-expanded"><a name="L2267"></a><tt class="py-lineno">2267</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2268"></a><tt class="py-lineno">2268</tt>  <tt class="py-line"><tt class="py-docstring">        Create a metaballs along the given coordinates</tt> </tt>
<a name="L2269"></a><tt class="py-lineno">2269</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L2270"></a><tt class="py-lineno">2270</tt>  <tt class="py-line"><tt class="py-docstring">        @type  name: string</tt> </tt>
<a name="L2271"></a><tt class="py-lineno">2271</tt>  <tt class="py-line"><tt class="py-docstring">        @param name: name of the metaballs object</tt> </tt>
<a name="L2272"></a><tt class="py-lineno">2272</tt>  <tt class="py-line"><tt class="py-docstring">        @type  listePt: list of array xyz</tt> </tt>
<a name="L2273"></a><tt class="py-lineno">2273</tt>  <tt class="py-line"><tt class="py-docstring">        @param listePt: coordinate foreach bone  </tt> </tt>
<a name="L2274"></a><tt class="py-lineno">2274</tt>  <tt class="py-line"><tt class="py-docstring">        @type  listeR: list of float</tt> </tt>
<a name="L2275"></a><tt class="py-lineno">2275</tt>  <tt class="py-line"><tt class="py-docstring">        @param listeR: radius foreach ball </tt> </tt>
<a name="L2276"></a><tt class="py-lineno">2276</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   host Object</tt> </tt>
<a name="L2277"></a><tt class="py-lineno">2277</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created metaballs</tt> </tt>
<a name="L2278"></a><tt class="py-lineno">2278</tt>  <tt class="py-line"><tt class="py-docstring">        @rtype:   list of bone/metaball data</tt> </tt>
<a name="L2279"></a><tt class="py-lineno">2279</tt>  <tt class="py-line"><tt class="py-docstring">        @return:  the created ball        </tt> </tt>
<a name="L2280"></a><tt class="py-lineno">2280</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt>                 </tt>
<a name="L2281"></a><tt class="py-lineno">2281</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2282"></a><tt class="py-lineno">2282</tt>  <tt class="py-line"> </tt>
<a name="L2283"></a><tt class="py-lineno">2283</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2284"></a><tt class="py-lineno">2284</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Mesh Function</tt> </tt>
<a name="L2285"></a><tt class="py-lineno">2285</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2286"></a><tt class="py-lineno">2286</tt>  <tt class="py-line"><tt class="py-comment"></tt> </tt>
<a name="Helper.getMeshVertices"></a><div id="Helper.getMeshVertices-def"><a name="L2287"></a><tt class="py-lineno">2287</tt> <a class="py-toggle" href="#" id="Helper.getMeshVertices-toggle" onclick="return toggle('Helper.getMeshVertices');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMeshVertices">getMeshVertices</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">poly</tt><tt class="py-op">,</tt><tt class="py-param">selected</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMeshVertices-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMeshVertices-expanded"><a name="L2288"></a><tt class="py-lineno">2288</tt>  <tt class="py-line">        <tt class="py-comment">#return selected vertices of the given polygon in python format</tt> </tt>
<a name="L2289"></a><tt class="py-lineno">2289</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2290"></a><tt class="py-lineno">2290</tt>  <tt class="py-line">         </tt>
<a name="Helper.getMeshNormales"></a><div id="Helper.getMeshNormales-def"><a name="L2291"></a><tt class="py-lineno">2291</tt> <a class="py-toggle" href="#" id="Helper.getMeshNormales-toggle" onclick="return toggle('Helper.getMeshNormales');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMeshNormales">getMeshNormales</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">poly</tt><tt class="py-op">,</tt><tt class="py-param">selected</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMeshNormales-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMeshNormales-expanded"><a name="L2292"></a><tt class="py-lineno">2292</tt>  <tt class="py-line">        <tt class="py-comment">#return selected normals of the given polygon in python format</tt> </tt>
<a name="L2293"></a><tt class="py-lineno">2293</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2294"></a><tt class="py-lineno">2294</tt>  <tt class="py-line">         </tt>
<a name="Helper.getMeshEdge"></a><div id="Helper.getMeshEdge-def"><a name="L2295"></a><tt class="py-lineno">2295</tt> <a class="py-toggle" href="#" id="Helper.getMeshEdge-toggle" onclick="return toggle('Helper.getMeshEdge');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMeshEdge">getMeshEdge</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">hostedge</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMeshEdge-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMeshEdge-expanded"><a name="L2296"></a><tt class="py-lineno">2296</tt>  <tt class="py-line">        <tt class="py-comment">#return the host edge of the given polygon in python format</tt> </tt>
<a name="L2297"></a><tt class="py-lineno">2297</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2298"></a><tt class="py-lineno">2298</tt>  <tt class="py-line">         </tt>
<a name="Helper.getMeshEdges"></a><div id="Helper.getMeshEdges-def"><a name="L2299"></a><tt class="py-lineno">2299</tt> <a class="py-toggle" href="#" id="Helper.getMeshEdges-toggle" onclick="return toggle('Helper.getMeshEdges');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMeshEdges">getMeshEdges</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">poly</tt><tt class="py-op">,</tt><tt class="py-param">selected</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMeshEdges-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMeshEdges-expanded"><a name="L2300"></a><tt class="py-lineno">2300</tt>  <tt class="py-line">        <tt class="py-comment">#return selected edges of the given polygon in python format</tt> </tt>
<a name="L2301"></a><tt class="py-lineno">2301</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2302"></a><tt class="py-lineno">2302</tt>  <tt class="py-line">         </tt>
<a name="Helper.getFace"></a><div id="Helper.getFace-def"><a name="L2303"></a><tt class="py-lineno">2303</tt> <a class="py-toggle" href="#" id="Helper.getFace-toggle" onclick="return toggle('Helper.getFace');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getFace">getFace</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">hostface</tt><tt class="py-op">,</tt><tt class="py-param">r</tt><tt class="py-op">=</tt><tt class="py-name">True</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getFace-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getFace-expanded"><a name="L2304"></a><tt class="py-lineno">2304</tt>  <tt class="py-line">        <tt class="py-comment">#return the host face of the given polygon in python format</tt> </tt>
<a name="L2305"></a><tt class="py-lineno">2305</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2306"></a><tt class="py-lineno">2306</tt>  <tt class="py-line">             </tt>
<a name="Helper.getFaces"></a><div id="Helper.getFaces-def"><a name="L2307"></a><tt class="py-lineno">2307</tt> <a class="py-toggle" href="#" id="Helper.getFaces-toggle" onclick="return toggle('Helper.getFaces');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getFaces">getFaces</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">object</tt><tt class="py-op">,</tt><tt class="py-param">selected</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getFaces-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getFaces-expanded"><a name="L2308"></a><tt class="py-lineno">2308</tt>  <tt class="py-line">        <tt class="py-comment">#return selected faces of the given polygon in python format</tt> </tt>
<a name="L2309"></a><tt class="py-lineno">2309</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2310"></a><tt class="py-lineno">2310</tt>  <tt class="py-line">         </tt>
<a name="Helper.getMeshFaces"></a><div id="Helper.getMeshFaces-def"><a name="L2311"></a><tt class="py-lineno">2311</tt> <a class="py-toggle" href="#" id="Helper.getMeshFaces-toggle" onclick="return toggle('Helper.getMeshFaces');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#getMeshFaces">getMeshFaces</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">poly</tt><tt class="py-op">,</tt><tt class="py-param">selected</tt><tt class="py-op">=</tt><tt class="py-name">False</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.getMeshFaces-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.getMeshFaces-expanded"><a name="L2312"></a><tt class="py-lineno">2312</tt>  <tt class="py-line">        <tt class="py-comment">#return selected faces of the given polygon in python format</tt> </tt>
<a name="L2313"></a><tt class="py-lineno">2313</tt>  <tt class="py-line"><tt class="py-comment"></tt>        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-267" class="py-name"><a title="upy.hostHelper.Helper.getFaces" class="py-name" href="#" onclick="return doclink('link-267', 'getFaces', 'link-126');">getFaces</a></tt><tt class="py-op">(</tt><tt class="py-name">poly</tt><tt class="py-op">,</tt><tt class="py-name">selected</tt><tt class="py-op">=</tt><tt class="py-name">selected</tt><tt class="py-op">)</tt> </tt>
</div><a name="L2314"></a><tt class="py-lineno">2314</tt>  <tt class="py-line"> </tt>
<a name="Helper.triangulate"></a><div id="Helper.triangulate-def"><a name="L2315"></a><tt class="py-lineno">2315</tt> <a class="py-toggle" href="#" id="Helper.triangulate-toggle" onclick="return toggle('Helper.triangulate');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#triangulate">triangulate</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-param">poly</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.triangulate-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.triangulate-expanded"><a name="L2316"></a><tt class="py-lineno">2316</tt>  <tt class="py-line">        <tt class="py-docstring">"""</tt> </tt>
<a name="L2317"></a><tt class="py-lineno">2317</tt>  <tt class="py-line"><tt class="py-docstring">        Convert quad to triangle the selected face of the given polygon object</tt> </tt>
<a name="L2318"></a><tt class="py-lineno">2318</tt>  <tt class="py-line"><tt class="py-docstring">        @type  poly: hostObj</tt> </tt>
<a name="L2319"></a><tt class="py-lineno">2319</tt>  <tt class="py-line"><tt class="py-docstring">        @param poly: the object to triangulate</tt> </tt>
<a name="L2320"></a><tt class="py-lineno">2320</tt>  <tt class="py-line"><tt class="py-docstring">        """</tt> </tt>
<a name="L2321"></a><tt class="py-lineno">2321</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2322"></a><tt class="py-lineno">2322</tt>  <tt class="py-line">         </tt>
<a name="L2323"></a><tt class="py-lineno">2323</tt>  <tt class="py-line">     </tt>
<a name="L2324"></a><tt class="py-lineno">2324</tt>  <tt class="py-line"><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2325"></a><tt class="py-lineno">2325</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment"># Advanced Function</tt> </tt>
<a name="L2326"></a><tt class="py-lineno">2326</tt>  <tt class="py-line"><tt class="py-comment"></tt><tt class="py-comment">#===============================================================================</tt> </tt>
<a name="L2327"></a><tt class="py-lineno">2327</tt>  <tt class="py-line"><tt class="py-comment"></tt>    </tt>
<a name="L2328"></a><tt class="py-lineno">2328</tt>  <tt class="py-line">     </tt>
<a name="Helper.setRigidBody"></a><div id="Helper.setRigidBody-def"><a name="L2329"></a><tt class="py-lineno">2329</tt> <a class="py-toggle" href="#" id="Helper.setRigidBody-toggle" onclick="return toggle('Helper.setRigidBody');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#setRigidBody">setRigidBody</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.setRigidBody-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.setRigidBody-expanded"><a name="L2330"></a><tt class="py-lineno">2330</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2331"></a><tt class="py-lineno">2331</tt>  <tt class="py-line"> </tt>
<a name="Helper.pathDeform"></a><div id="Helper.pathDeform-def"><a name="L2332"></a><tt class="py-lineno">2332</tt> <a class="py-toggle" href="#" id="Helper.pathDeform-toggle" onclick="return toggle('Helper.pathDeform');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#pathDeform">pathDeform</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.pathDeform-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.pathDeform-expanded"><a name="L2333"></a><tt class="py-lineno">2333</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L2334"></a><tt class="py-lineno">2334</tt>  <tt class="py-line">     </tt>
<a name="Helper.updatePathDeform"></a><div id="Helper.updatePathDeform-def"><a name="L2335"></a><tt class="py-lineno">2335</tt> <a class="py-toggle" href="#" id="Helper.updatePathDeform-toggle" onclick="return toggle('Helper.updatePathDeform');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="upy.hostHelper.Helper-class.html#updatePathDeform">updatePathDeform</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt><tt class="py-op">*</tt><tt class="py-param">args</tt><tt class="py-op">,</tt><tt class="py-op">**</tt><tt class="py-param">kw</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Helper.updatePathDeform-collapsed" style="display:none;" pad="++++" indent="++++++++"></div><div id="Helper.updatePathDeform-expanded"><a name="L2336"></a><tt class="py-lineno">2336</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div></div><a name="L2337"></a><tt class="py-lineno">2337</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="upy-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

      <th class="navbar" width="100%"></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1
    on Fri Oct 28 09:07:29 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
